3.2 Rtlinux Inter-Process Communication (Ipc)
3.2 Rtlinux Inter-Process Communication (Ipc)
3.2 Rtlinux Inter-Process Communication (Ipc)
is done in user space. This approach makes for easier debugging and better understanding of the realtime part of the system. Consequently, communication mechanisms are necessary to interface RTLinux tasks and Linux. RTLinux provides several mechanisms which allow communication between realtime threads and user space Linux processes. The most important are realtime FIFOs and shared memory.
#include <mbuff.h> void * mbuff_alloc(const char *name, int size); void mbuff_free(const char *name, void * mbuf); The first time mbuff alloc is called with a given name, a shared memory block of the specified size is allocated. The reference count for this block is set to 1. On success, the pointer to the newly allocated block is returned. NULL is returned on failure. If the block with the specified name already exists, this function returns a pointer that can be used to access this block and increases the reference count. .4. INTERRUPTS 27 Functions with the p suffix (e.g., outb p) provide a small delay after reading or writing to the port. This delay is needed for some slow ISA devices on fast machines. (See also the Linux I/O port programming mini-HOWTO). Check out examples/sound to see how some of these functions are used to program the PC realtime clock and the speaker.
void rtl_free_soft_irq(unsigned int irq); The rtl get soft irq(3) function allocates a virtual irq number and installs the handler function for it. This virtual interrupt can later be triggered using rtl global pend irq(3) . rtl global pend irq is safe to use from realtime threads and realtime interrupts. rtl free soft frees the allocated virtual interrupt.
Mass Storage - hardware This is about Disk Behavior and Management. Disk Characteristics Space Management RAID Disk Attachment IO Interface how the OS interfaces to the hardware The busses in the computer and how the O.S. interfaces to it. Talking to the IO Polling, Interrupts and DMA Application IO Interface Kernel IO Subsystem
Mass-Storage Structure
A disk can be viewed as an array of blocks. In fact, a file system will want to view it at that logical level. However, there's a mapping scheme from logical block address B, to physical address (represented by a track / sector pair.) The smallest storage allocation is a block - nothing smaller can be placed on the disk. This results in unused space (internal fragmentation) on the disk, since quite often the
The components making up disk service time include: time = setup + seek + rotation time + transfer + wrap-up The methods discussed below try to optimize seek time but make no attempt to account for the total time. The ideal method would optimize the total time and many controllers are now able to accomplish this. Disk formatting Creates a logical disk from the raw disk. Includes setting aside chunks of the disk for booting, bad blocks, etc. Also provides information needed by the driver to understand its positioning. Boot block That location on the disk that is accessed when trying to boot
the operating system. It's a well-known location that contains the code that understands how to get at the operating system - generally this code has a rudimentary knowledge of the file system. Bad blocks The driver knows how to compensate for a bad block on the disk. It does this by putting a pointer, at the location of the bad block, indicating where a good copy of the data can be found. Swap Space Management The Operating System requires a contiguous space where it knows that disk blocks have been reserved for paging. This space is needed because a program can't be given unshared memory unless there's a backing store location for that memory
Network-attached storage
Network-attached storage (NAS) is storage made available over a network rather than over a local connection (such as a bus) NFS and CIFS are common protocols Implemented via remote procedure calls (RPCs) between host and storage New iSCSI protocol uses IP network to carry the SCSI protocol