================ DOS architecture ================ ---------- | loadable | -------- | drivers | ------------ ---------- --------- | | | (.SYS | | C-compiled | fopen() | | syscalls | |--->| files) | | user prog | fread() | std C | INT 21h | DOS | ---------- | e.g. shell |--------->| library |--------->| kernel | ---------- | or editor | printf() | (libc) | | | | video | | | malloc() | | | |--->| and | ------------ ---------- --------- | | | mother- | | -------- | board | | BIOS interrupts | ROM | ---------------------------->| BIOSes | ---------- 1. DOS has no dynamic linking (DLLs). If user prog uses malloc() function, object code for malloc() is pulled from standard C library and put in user prog at compile-time (static linking). Exercise: compile under Linux, compare executable sizes gcc -O2 -s -o hello hello.c gcc -O2 -s -o hello -static hello.c 2. The syscalls are implemented mainly with software interrupt 21 hex (INT 21h). The value in the AH register when INT 21h is called tells DOS what service is desired (open file, read file, get time, change directory, etc). 3. DOS does not provide multitasking, protection, or networking, though networking can be provided by drivers. 4. DOS kernel provides only DOS filesystem (FAT), though other filesystems (CD-ROM or network) can be provided by drivers. 5. DOS does not provide video, keyboard, or disk I/O. The BIOSes handle these.