Re:The Design and Implementation of Userland Exec (2014)
by Animats on Monday August 07, 2023 @02:30AM
(#37030928)
QNX always did it that way. One of their basic design decisions was to never process strings or complex data formats in the kernel. That's all in user space, which is good for crash prevention. It's hard to have kernel buffer overflows when you don't have kernel buffers.
The boot loader loaded an image into memory which contained the kernel, a utility process called "proc", and whatever else needed to be available at startup. For an embedded application, that might be the entire program. For a standard desktop environment, it would include a disk driver, a network driver, and a startup program.
Shared object files could also be loaded as part of the initial image. One of them was the program loader. The C library for QNX had calls for the various 'exec' functions, but they were just passed to the program loader shared object. With no special privileges, it allocated the memory for the new program, read in the program image, set up the Unix-type args, and transferred control to the newly loaded program.
The boot loader loaded an image into memory which contained the kernel, a utility process called "proc", and whatever else needed to be available at startup. For an embedded application, that might be the entire program. For a standard desktop environment, it would include a disk driver, a network driver, and a startup program.
Shared object files could also be loaded as part of the initial image. One of them was the program loader. The C library for QNX had calls for the various 'exec' functions, but they were just passed to the program loader shared object. With no special privileges, it allocated the memory for the new program, read in the program image, set up the Unix-type args, and transferred control to the newly loaded program.