. ---------- ---------- ================== . | security || whatever | Linux architecture . | || | ================== . ---------- ---------- . ^ ^ . | | . -------- --------- ------------ --------- . | | | file- | | C-compiled | fopen() | shared | syscalls | |--->| systems | | user prog | fread() | std C | INT 80h | Linux | --------- | e.g. shell |--------->| library |--------->| kernel | --------- | or editor | printf() | | . | | | block | | | malloc() | libc.so | . | |--->| devices | ------------ --------- . | | --------- . -------- . | | USER . SYSTEM | --------- PRIVILEGE . PRIVILEGE v v . --------- --------- . | network || char | . | devices || devices | . --------- --------- 1. Linux usually uses dynamic linking (though it can also use static linking). If user prog uses malloc() function, object code for malloc() remains in the libc.so file, and is linked to user prog at run-time. libc code pulled into memory during dynamic linking is shared with many programs running at once (saves memory). DOS does not multitask, so it does not need dynamic linking. 2. The syscalls are implemented with software interrupt 80 hex (INT 80h). The value in the EAX register when INT 80h is called tells the kernel what service is desired (open file, read file, get time, change directory, etc). 3. User prog can NOT go directly to hardware or device driver: it must go through kernel. 4. User prog and libc run in "user mode". When the CPU is in this mode, certain instructions are forbidden, mainly the instructions that disable interrupts. Timer interrupt returns control from user prog to kernel, and switches to system mode. This allows safe and fair multitasking. 5. Many Linux services can either be compiled into the kernel, or built as loadable modules, linked to the kernel at run-time using 'insmod'. 6. Linux supports many filesystems besides DOS (CD-ROM, Minix, OS/2, Macintosh, Amiga, other versions of UNIX, Windows NT, network filesystems, etc). 7. UNIX requires certain filesystem features like device files and file ownership/mode, so DOS filesystem alone can't be used with Linux/UNIX. 8. Linux does not use the BIOS. This is because Linux runs in 32-bit protected mode, and BIOS code is meant to be used in 16-bit real mode.