Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ Developer Release Notes: BeOS Release 4.5, The Kernel Kit

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Developer Release Notes: BeOS Release 4.5, The Kernel Kit

 index   headlines   <<previous   next>> 

The Kernel Kit
Developer Release Notes
BeOS Release 4.5

Bug Fixes and Improvements

  • snooze(), send_data(), and receive_data() are set to be uninterruptible by default.

  • Some new CPU constants have been added to the cpu_type list.

  • set_thread_priority() checks for sensible argument values—nonsensical values are rejected.


Team Usage

      The new get_team_usage_info() function retrieves cycle-consumption data for a team:

status_t get_team_usage_info(team_id team, int32 depth, team_usage_info *usage);

team is the team_id of the team you want to look at.  depth is one of these two constants:

ConstantMeaning
B_USAGE_SELF Gets statistics for the designated team.  Normal applications will always use this constant.
B_USAGE_CHILDREN Gets statistics for the designated team's "children," where a child is a separate process (a whole other team, actually) that's executed from a forked thread.  Child usage is only meaningful to certain POSIX apps -- you know who you are.

usage returns the statistics in a team_usage_info struct:

typedef struct {
   bigtime_t user_time;
   bigtime_t kernel_time;
} team_usage_info;

The fields are:

FieldMeaning
user_time Amount of time spent executing user code.
kernel_time Amount of time spent executing kernel code.

If the function doesn't return B_OK, the information in usage is invalid.


Port Closure

  • Proper atomic closing of ports is now possible through close_port():

    status_t close_port(port_id port);

    Calling this function on a port will lock the port against further writes.   A closed port can be read, but attempts to write to the port return B_BAD_PORT_ID.   Read or write calls that are blocked on the port when the port is closed are immediately unblocked and return an error.


Semaphore Timeout

      There are two new timeout flags that you pass to acquire_sem_etc():

  • B_ABSOLUTE_TIMEOUT sets the timeout as an absolute time since the system was booted.

  • B_RELATIVE_TIMEOUT sets the timeout as a relative amount (relative to now).

The old B_TIMEOUT flag is the same as B_RELATIVE_TIMEOUT; the old flag will continue work, but new code should use the new flags.


Alarms

      The new set_alarm() function lets you ask for a SIGALRM signal to be sent after some amount of time:

bigtime_t set_alarm(bigtime_t when, uint32 flag);

The flag value determines how the when value is interpreted:

FlagMeaning
B_ONE_SHOT_ABSOLUTE_ALARM The signal is sent once; when is an absolute time.
B_ONE_SHOT_RELATIVE_ALARM The signal is sent once; when is relative to now.
B_PERIODIC_ALARM The signal is sent iteratively, every when microseconds.

If this is a periodic alarm, the set_alarm() function returns 0; otherwise, the function returns the absolute time that the handler will be called.


Kernel Drivers

  • New timer interrupt functions let your driver ask for timer interrupts.  Look for add_timer() and cancel_timer() in <drivers/KernelExport.h>.

  • New driver settings API lets your driver read driver-specific parameters.  Look for load_driver_settings() and get_driver_settings() in <drivers/driver_settings.h>.



 index   headlines   <<previous   next>> 

BeOS Release 4.1


Copyright © 1999 Be, Inc.  All rights reserved.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026