This document answers questions regarding developing for the BeOS, including details of
the Be Developers program, API documentation, and BeOS internal details.
Be Developer Program
Q: Why should I, the developer, want to write software for the BeOS?
A: The BeOS offers an excellent opportunity for developers interested in performance hungry multimedia applications. It offers developers a excellent new opportunity, with low entry cost on a new and interesting platform.
We like to use the following formula for thinking about how and why developers become interested in a computing platform:
(Opportunity / Cost) x Innovation = Developer Interest
Opportunity = the amount of money/exposure a particular platform will provide.
The BeOS offers a rapidly growing installed base with application hungry end users. We expect to ship between 500 thousand and 1 million copies of the BeOS Preview Release before the end of 1997, and an additional 5 million units in 1998. The first thing that these users will want are applications that take advantage of the BeOS.
Another important advantage for the BeOS is that it offers a "protected harbor" for smaller developers to create, bring to market, and sell their modern OS applications before entering other extremely competitive
marketplaces.
Cost = the cost of developing and marketing the product.
For many developers, the BeOS offers a low development cost due to a lean
API, the lack of legacy baggage, and the use of C++ and MetroWerks tools familiar to many developers.
Just as important is that marketing and distribution costs are significantly lower compared to existing markets. This is due to lack of established competitors and use of electronic distribution, which radically lowers distribution costs. These two factors mean that small developers can realistically enter and establish themselves in the BeOS marketplace.
Innovation = this is an intangible that attracts many developers
simply because they can do things never done before. The BeOS offers
developers new capabilities, a lean API, and a "low-friction" operating system that enables them to rapidly develop applications never before possible.
Q: How do I join the Be Developer program?
A: The process is very simple. A developer must fill out an application
on our website:
http://www.be.com/developers/devprogramapp.html
There are four criteria to be included in our program.
- you must know C++ or Java as those are the languages we support
- you must have some experience developing code
- you must tell us what you would like to do on the BeOS
- you must have an email account so we can contact you
There is no cost to be join the Be developer program, and a "lite" version
of the Metrowerks CodeWarrior tools for the BeOS are included with the
BeOS Preview Release, which all developers will receive automatically. So becoming a registered and productive Be developer is a simple and inexpensive proposition. :-)
Q: What does joining the Be Developer program get me? Why would I join the program?
A: The benefits of the Be Developer program are evolving over time, and are
subject to change. The program goal will remain the same, however: to
help our developers be successful in bringing BeOS applications to
market, and to be profitable selling them.
To that end, here are the current program benefits:
- Access to the Be Registered Developer section of the Be Web site, which allows you to update your developer contact information
- The ability to list (and soon sell) your BeOS software on the Be Web site, in the BeWare section
- Access to the devsupport@be.com e-mail address for technical and coding assistance from our developer technical support staff
- Subscription to the BeDevNews mailing list, for Be developer-only
announcements
- Special notification of and inclusion in Be Developer Conferences and
Kitchens
- Discounts on SuperMac computers (see next item)
- Be will send you the BeOS Preview Release CD-ROM.
If you have any suggestions for improving the Be developer program, we
want to know! Send us mail with your suggestion today!
Q: Does Be give registered developers discounts on hardware?
A: Because Be does not manufacture or sell hardware anymore, we are obviously unable to give a direct discount on BeOS-ready hardware.
Instead, we are pleased to announce that UMAX is offering registered BeOS developers a discount on UMAX/SuperMac hardware and a free second processor card, giving registered Be developers the opportunity to purchase multiprocessor hardware at a great price.
Details of the program can be found in the Registered Developer area of the Be web site.
Q: Which UMAX machine should I buy? Are there machines that run better with the BeOS?
A: While Be does not make specific hardware (or vendor) recommendations, there are a couple of things you might want to keep in mind when deciding which UMAX/SuperMac machine to purchase through the Be developer program.
- Not all UMAX products are able to use the secondary processor card which you can receive for free through the program. At the time of this writing, only the S900 line can accept a secondary processor card, so if you want a multiprocessor unit, that's the way to go.
- The BeOS does not support asymmetrically clocked CPUs, that is, all CPUs must run at the same clock rate. So if you want to use the 180 MHz secondary processor card offered through the program, you'll need to have a 180 MHz machine.
Obviously, these notes are both brief and subject to change as UMAX' product line changes, so be sure to visit the SuperMac web site for detailed and up-to-date information. In particular, we recommend the SuperMac FAQ section (FAQs are good ;-) for details regarding the multiprocessor options for their product line.
Q: I really want a faster machine (faster, faster, faster!). Instead of getting a 180 MHz secondary processor card for free, can I pay the difference to get a faster secondary processor card (and therefore use it in a faster computer)?
A: Yes (starting 7/14/97)! We'll have details on the web site, in the Registered Developer area.
Q: Is there a cost to join the Be developer program?
A: As part of our on-going commitment to our third-party developers, there is no fee to join the Be developer program.
Q: What does it mean if I'm not accepted into the Be developer program? Does it mean that Be does not think I am worthy?
A: No, not at all! Please don't think that!
A great many of the applications which we ultimately do not accept are rejected simply because the application was not filled out completely. It seems silly to write this, but filling out the application form correctly and completely makes a big difference in whether you will be accepted into the program or not! In general, the more detail you give, the better your chances of acceptance.
In other cases, a non-acceptance means we don't think a developer will actually get any utility out of the program, which is oriented towards developers who wish to bring a product to market in a timely manner.
There is very little that a registered Be developer has access to that a unregistered developer will not. You do not need to be a registered Be developer to write BeOS software! Check the answer to the next question for details.
Q: Do I need to be a registered Be developer to develop software for the BeOS?
A: Not at all!
While it can be advantageous to join the Be developer program (see a previous question for details of program benefits), there are plenty of folks developing for the BeOS who are not in the program.
The primary benefit of joining the program is access to our Developer Technical Support group. But everyone, registered developer or not, has access to the technical and other information we publish on the Web. This includes the Be Book, which covers the BeOS APIs, sample code, various tutorials, the Be Newsletter, etc.
Browse the various resources we make available to all developers, registered or not. There is very little that is restricted to only registered developers! And if you have suggestions for things to add, please tell us!
http://www.be.com/developers/index.html
Q: Do I need to own a BeBox to be a registered Be developer?
A: No. You can use either a BeBox or a PowerMac running the BeOS to develop BeOS applications.
So if you're working on a software project for the BeOS, and would like
to join the Be developer program, fill out an application on our Web site:
http://www.be.com/developers/devprogramapp.html
Q: Do I need to own a BeBox to develop software for the BeOS?
A: No. You can use either a BeBox or a PowerMac running the BeOS to develop BeOS applications.
So if you're working on a software project for the BeOS, and would like
to join the Be Developer program, fill out an application on our Web site:
http://www.be.com/developers/devprogramapp.html
The BeOS comes with a "lite" version of CodeWarrior which is the primary development tool for the BeOS.
Q: I hope that you realize the importance of developer support. I have been burnt by poor developer support from Commodore, Apple, and NeXT in the past while attempting to develop for their innovative machines and I hope you will not fall into the same trap.
A: It is certainly our intention to not make the same mistakes as these other platforms. We think if you give us a chance you'll see we're very serious about supporting our third party developers.
Developer Tools
Q: How do developers get the BeOS Preview Release? How will we get future releases?
A: All developers who attend the Be Developer Conference will receive the BeOS Preview Release CD. In addition, the BeOS Preview Release will be sent to all updated registered Be developers and BeBox owners.
In general, Be believes that to get developers to write software for the BeOS, we have to get the BeOS into their hands. So, when there are new releases of the OS, we generally send them to our developers, automatically. All you have to do is make sure your developer record is up-to-date, so we send it to your correct address.
Q: When did you send out the final version of the BeOS Preview Release?
A: If you are an updated and registered Be developer or owner of a BeBox, you were sent a copy of the final BeOS Preview Release CD-ROM on the following schedule:
Current Be Developers (CD only):
Domestic (US) -- shipped via US postal mail on 7/15
European -- should ship via French postal mail on 7/16-18
Other International -- shipped via US postal mail on 7/16
BeBox Owners (CD and boot ROM floppy):
Domestic (US) -- shipped via US postal mail on 7/15
European -- shipped via French postal mail on 7/16
Other International -- shipped via US postal mail on 7/15
Multiple 'Box owners (all) -- shipped FedEx on 7/14
Q: Why was my Preview Release shipment delayed, or not received?
A: First of all, please keep in mind that US postal mail takes time to be delivered, especially internationally. Even Federal Express takes a few days to ship internationally.
Second, the number one cause of delivery problems (including "missing" boot ROM floppies) is either out-of-date address information, or not being in our database at all.
If you are a registered Be developer and you want to make sure your copies of the BeOS, including future releases, make their way to your mailbox in a timely fashion -- especially if there were delivery problems with a previous release -- be sure to give your developer record a look to make sure it really is up-to-date:
http://www.be.com/developers/devprogramintro.html
If you are a BeBox owner and you experienced delivery problems, including a missing boot ROM floppy, make sure your developer record is up-to-date (if you have one), and send custservice@be.com your current shipping address and BeBox serial number, so we can make sure our ownership records are accurate.
Q: OK, that's cool. What do I do now about a missing boot ROM floppy?
A: First of all, make sure you send custservice@be.com your current shipping address and BeBox serial number, so we can make sure our ownership records are accurate.
You can at the same time request a boot ROM floppy be sent to you.
Q: Does the BeOS include a compiler and development environment? Or does that only come with a BeBox?
A: We supply a native development environment from Metrowerks on our standard BeOS CD-ROM. This is an integrated development environment similar to CodeWarrior on other platforms. It includes the IDE and C++ and Java compilers you need to write BeOS applications.
The linker is limited to 64K for the size of applications you can link with it. This limit is high enough that utility software and simple applications can be built without a problem, but low enough that anyone wanting to build a large program (say, larger than StyledEdit) will need to buy the full version of CodeWarrior for BeOS to get the unrestricted linker.
Q: Does the BeOS have a graphical interface builder for quickly and easily building an application's human interface?
A: There are currenly two third party tools available. BeatWare has a product called AppSketcher. You can read more details, and download the latest developer release, on the Be web site:
http://www.be.com/developers/AppSketcher/index.html
You can also visit the BeatWare web site for more information about
their products and services:
http://www.beatware.com/
Attila Mezei has created a product called Interface Elements. You can
read more details about it, and download the latest developer release,
on the Interface Elements web site:
http://w3.datanet.hu/~amezei/IE/
Q: What is the current BeOS development platform?
A: C++ in Metrowerks CodeWarrior running native under the BeOS. The current release of CodeWarrior for BeOS Preview Release is R3.
Q: Does CodeWarrior for BeOS work on both BeOS for the BeBox and BeOS for Power Macintosh? Is there any loss of functionality, or other differences?
A: CodeWarrior for BeOS does not care what hardware you run it on, just that it is running under the BeOS. Nor are there any differences in the software depending on which hardware you use.
Note that this may not be true for the software you develop using CodeWarrior. If your software tries to access hardware that doesn't exist on the hardware you have, e.g., a parallel port on a Power Mac, that obviously isn't going to work, no matter what kind of magic the folks at Metrowerks (or at Be, for that matter) perform!
Q: I've been told that the developer package includes "Be libraries and headers for Be and Macintosh CodeWarrior IDE." Do I still need to purchase CodeWarrior for BeOS and Macintosh? I currently use Symantec C++.
A: Metrowerks has split CodeWarrior for Macintosh and CodeWarrior for BeOS into two separate products. You can use either product, but to develop for the BeOS, you need the BeOS headers and libraries. As of CodeWarrior 11, these are no longer included in the CodeWarrior for Macintosh package.
The BeOS CD-ROM comes with a version of the Metrowerks BeIDE that has a linker limited to 64K, but you can upgrade to the full version through Metrowerks. The CD also includes all the headers and libraries necessary to develop for the BeOS.
You cannot use Symantec's compilers at this time, unfortunately.
Q: I would love to develop software for the BeOS, but I only have a PC. Is there any way to develop the code on a PC and then port it to the BeOS?
A: You cannot today develop for the BeOS on an Intel-based machine. Currently your only option is to develop natively on the BeOS, running on either a Power Mac or a BeBox.
Q: Why did Be choose C++ as the development environment?
A: We know C++ is not perfect, but the availability of good compilers was very important to us. The encouragement we've received from developers for our choice of the entire Metrowerks environment makes us think we made the right choice.
Developer Documentation
Q: Where can I find the APIs for the BeOS file system, devices, and other parts of the BeOS?
A: The primary documentation for the BeOS APIs is called the Be Book. This and all BeOS end user and developer documentation is in the documentation folder on every BeOS CD-ROM in HTML format.
The most current versions are always available on our Web site in various formats, in the documentation section:
http://www.be.com/documentation/
Q: Is there an introductory book on programming for the BeOS (something that starts with "Hello World" and goes on from there)?
A: Although almost everyone finds it surprisingly easy to start programming the BeOS, at the present time there are no third-party "Programming the BeOS" type books (we do know of a few currently being written). The Be Book contains architectural information that should help get you started.
Be's own Mark Gonzales has written "Approaching Be", an introduction to the BeOS for the programmer just getting started with the BeOS. It offers insight into how BeOS programs are structured and how applications interact with the Servers and Kits of the BeOS. You can find this excellent starting point at:
http://www.be.com/developers/tutorials/approachingBe.html
Be is also developing an ongoing tutorial series for programmers interested in developing for the BeOS, and you can see this series on our Web site:
http://www.be.com/developers/tutorials/index.html
Q: Where and when can I see your headers and libraries? How about documentation?
A: Our docs, headers, and libraries are available on our Web and FTP sites! Check http://www.be.com/ or ftp://ftp.be.com/ for the latest versions of our docs and programming details.
We also include all the headers and libraries you need to program the BeOS, along with a limited programming environment, on the BeOS CD-ROM.
Q: Is it possible to buy the Be Book in paper format?
A: Regrettably, no, Be is no longer printing and selling a printed version of the Be Book.
We are working with O'Reilly & Associates to make the Be Book more widely available, and in a more nicely printed format than our old 3-ring binder. O'Reilly is doing their usual superb job, and we're very excited about having the Be Book published by them.
See the O'Reilly & Associates web page for the Be Book for more information, including format, pricing, and ordering information:
http://www.ora.com/catalog/be/
Q: What animal will the O'Reilly & Associates Be Book have on the cover? Please tell me it won't be a bee...
A: The O'Reilly & Associates version of the Be Book, at Be's decision, will not have any animal on the cover (though future BeOS-related books may very well have animals on them).
See the O'Reilly & Associates web page for the Be Book for more information, including format, pricing, a cover shot, and ordering information:
http://www.ora.com/catalog/be/
BeOS Technical Details
Q: Are task priorities easily modifiable by users and programmers?
A: For developers, yes, this is a simple process. You simply increase the priority of the thread in which a task is running.
For the end user to increase or decrease a task's priority, the developer of the program would need to provide a slider bar (or other interface element) to access the program's thread priority setting, and then write code around that to increase or decrease the priority accordingly.
Note that setting the priority of a thread is not a "speed throttle;" setting a thread's priority very high will not make it execute faster, unless there is contention for the CPU, i.e., other things going on, too. And in that case, a high priority for a task will make other things (such as window moves, menu responses, screen redraw for other applications, etc.) happen more slowly, which may not be desirable.
For more information on threading, there's a Be Newsletter article at:
http://www.be.com/aboutbe/benewsletter/Issue37.html#Insight
Q: How intelligent is the threading mechanism for multiple processors? Is it handled by the system or by the compiler (thus allowing optimization of processor use for code-specific needs)?
A: Threading is not implemented by the compiler. The system, in the Kits, spawns multiple threads on behalf of the applications where it is useful. The application developer can also manually create multiple threads of execution, and can set the priority of each of the application's threads. Any thread that is ready to run will be scheduled on any available processor. Even single processor systems benefit from the aggressive threading in the BeOS.
Q: When two tasks are running at the same priority, can a ratio of CPU usage between the two be specified?
A: No, you cannot set the ratio. Given two CPU intensive tasks (i.e., non-blocking) with the same priority, they will get approximately the same CPU time. That is, the ratio is basically .50/.50, although other factors (such as other running threads) will generally cause this to be slightly different.
Q: Is there a way for a processor to be allocated to a single, realtime task? There was some discussion on the BeDevTalk mailing list indicating that perhaps a single processor could be set aside for this purpose.
A: There is currently no way to explictly set aside one processor for the execution of a privileged task. You can get the realtime processing you're looking for by setting a high enough thread class and priority -- so high that it effectively consumes a CPU -- but you can't be specific about it. This is not a technical limitation, but a decision made during the design of the BeOS.
Q: What graphics language is used for programming BeOS applications?
A: We have a proprietary graphics language, which is similar to QuickDraw, the graphics language for the Mac OS, in many ways.
We also have 3D graphics support in the form of our 3D Kit and, coming in the Preview Release, the BeOS port of OpenGL. See our 3D White Paper and a Be Newsletter article about OpenGL for more details.
Q: How fast can BMessages be sent between applications?
A: There isn't a simple answer, as there are many ways to send messages. For example, you can send messages synchronously or asynchronously. As a rough benchmark, on the dual 66MHz BeBox you can send about 2,000 messages/replies per second. Of course, this will vary with the time you need to spend actually processing the message(s), but raw sends/receives are fast.
You can send about 10,000 32-byte messages/sec on a dual 66Mhz Bebox using the underlying port mechanism.
Q: With an object-oriented operating system, memory allocation and who is responsible for cleanup can get complicated. How does the BeOS handle this?
A: We try, whenever possible, to allow the developer to both allocate and deallocate memory in pairs. We strive not to have any unbalanced memory allocation or deallocation. So, if you allocate it, you release it and if you're passed a pointer to memory you haven't allocated then you should not release it.
Of course, there are a couple of exceptions to this rule which we tried to avoid but found difficult. Those are specifically called out in The Be Book, the documentation of the BeOS.
Finally, when a program exits, all of its resources are freed up by the kernel (open files are closed, memory freed, semaphores and ports deleted, etc.), though it is better when you do this yourself...
Q: Can I use Berkeley sockets?
A: Yes, the BeOS networking API is based on the Berkeley sockets network programming API.
Q: You say you support Berkeley sockets, does this include user datagram protocol UDP (SOCK_DGRAM
), RAW packets and internal communication (AF_UNIX
) or just TCP/IP (SOCK_STREAM
)?
A: We currently only support TCP/IP and UDP.
Q: Is it possible to migrate message ports (like in chorus) or even entire processes?
A: No.
Q: What is your segmentation scheme? Does it support indirection, like MULTICS?
A: The BeOS implements paged virtual memory. There is currently no way to override it. And no such thing is planned in the near future.
Q: Does your driver model follow the UNI* model or does yours allow for a preemptable kernel and nested interrupts?
A: Our kernel is preemptable and allows for nested interrupts. At this time, our drivers are not using nested interrupts.
Q: How fast should I poll the mouse for position changes? Should I just sit in a tight GetMouse(...)
loop?
A: If you poll the mouse position, do use a sleep time somewhere in the loop, otherwise you will waste a full CPU getting the mouse position 10,000 times per second!
For example:
while(xyz)
{GetMouse(&a_point etc...);
snooze(X microseconds);}
As a rule of thumb, polling about 50 times a second (i.e., every 20,000 +/- microseconds) seems about right.
Q: Can I get the source code for the mouse driver to add support for another pointing device myself?
A: Today, the mouse driver is too tightly integrated with the Application Server for this to be possible. We do plan to open this up to allow others to write new mouse/keyboard/tablet drivers, but this is not completely possible in the BeOS Preview Release.
See the Be Newsletter article by William Adams for more details, and some sample code for a Wacom tablet driver:
http://www.be.com/aboutbe/benewsletter/Issue78.html#Front
Q: Will it be hard for new PCI boards with 3D graphics accelerators and media processors to be integrated in the BeOS? In other words, can you create user-level OS extensions (new disk controllers, graphics cards, etc.)?
A: It is possible to develop drivers for new PCI cards as they become available. Drivers being dynamically loaded, no kernel relinking is necessary. You just need to drop the driver binary in the proper system folder, and you can then start playing with it.
The case of disk drivers is a bit more subtle. If you are designing a driver for a device you want to boot from, you obviously cannot rely on the dynamic loader in the kernel (our kernel itself is loaded from the boot device). This is why we have the drivers for all the boot devices statically linked with the boot ROM of the BeBox and the kernel.