Archive / / / 2002-07-18-OSNotes.txt
2002-07-18 12:26:56 UTC
previous next
-bitmap for under 16MB (for DMA), stack for above 16MB -under 16MB: two levels of bitmaps, one for 64KB blocks (for DMA), one for 4KB pages -kernal loads into 16MB (physical) -for drivers in user-space, map the first 16MB of physical memory as read/write into the first 16MB if virtual memory -64bit? -a20 line -protected mode -[BITS 32] -learn NASM and GCC and the GNU linker -buffer overflow - what is it.. -drives run as a user-mode process... programs use IPC to communicate with system process/drivers? -IPC - Shared Memory && Message passing (for notice when shared memory changes, etc. and small messages) (Shared Memory only for native apps and Win32 apps that have been complied with a special header designed for this OS) --Program asks kernal for some memory to share with another process (can ask for DMA area?) (sends other process's ID), sends the virtual address of the memory to use, kernal sends signal to other process that a program is requesting shared memory (or driver), process #2 accepts and tells kernal where to put the shared memory in its virtual memory (tells kernal to put it in DMA area? (for ATA drivers) Would allow hard drive to copy data DIRECTLY into the program = very fast) (all this can be hidden in C library, assembly programers use it directly).... --------********* What about Win32 emulation --Message passing --Directed Yields for IPC (http://cdsmith.twu.net/professional/osdesign/ch04.html) -loading: --stage 1: boot loader - loads /system/boot.sys into 1 MB, jumps to beginning (assembly) --stage 2: boot.sys - enables protected mode, a20 line, etc., loads /system/kernal.sys into 16 MB, loads memory management (/system/mem.sys), jumps to kmain() in kernal.sys (assembly) --stage 3: kernal.sys - --Network operating system (just make it easy to add later) -ACPI -Scedular: -- Each process/thread is assigned a number between 1-50. To find the percent of the CPU that the process/thread should have, add up all the numbers for all processes, and then divite the process proitory by this number. This should be cached, etc. for performance. -- Either: -- the percent is the time slice each gets if 100 percent is 1 second? -or -- -variable size swap file as part of filesystem -mix of using APIs and /dev files to access devices -/dev = /system/devices or /devices -_ is considered lowercase for a space in filenames -locks icons (for jeff :)) -PIC (Programmable Interrupt Controller (PIC)) http://www.mega-tokyo.com/os/os-faq-pics.html#irq_exception -NMI (Non Maskable Interrupt) http://www.mega-tokyo.com/os/os-faq-pics.html#irq_exception -APIC? -IDT (Interrupt descriptor table) -environment variables -extended memory/640kb limit -multiboot loader loads kernal into memory, replaces data in its data section with information about the system, (amount of memory, etc.), so the kernal starts with some variables pre-initialized (or maybe in the bss, its safer) -Time for each thread changes dynamically depending on how many threads there are, it is set to the highest possible while not letting any thread go without CPU for more then 100 ms. (Would this calculation slow the cpu too much?) -A process can be preempted if another process used a pricise timer function and wants to be called when it runs out --read GCC docs --read intel x86 docs --read x86-64 docs -kernal: ring 0 -driver: ring 1 (selective I/O access) -kernal module: ring 0 -programs: ring 3 -stack frames -conforming and non-conforming segments