1.mm(virtual memory -> physical memory)
GDT ( Global Descriptor Table )
- 0 NULL
- 1 kernel code
- 2 kernel data
- 3 user space code
- 4 user space data
entry point
- base -> entry address
- limit -> entry size
ex:
gdt_set_gate(0, 0, 0, 0, 0);
gdt_set_gate(1, 0, 0xFFFFFFFF, 0x9A, 0xCF);
gdt_set_gate(2, 0, 0xFFFFFFFF, 0x92, 0xCF);
gdt_set_gate(3, 0, 0xFFFFFFFF, 0xFA, 0xCF);
gdt_set_gate(4, 0, 0xFFFFFFFF, 0xF2, 0xCF);
IDT(interrupt description table)
Faults, traps and exceptions
ex:
- 0 - Division by zero exception
- 1 - Debug exception
- 2 - Non maskable interrupt
- 3 - Breakpoint exception
TSS(task state segment) @ system_call
store each tasks info to kernel schedule , such as eax,ebx,esp...
ex:
struct tss_entry_struct
{
u32int prev_tss;
u32int esp0;
u32int ss0;
u32int esp1;
....
}
paging
@ virtual memory call
block -> used
hole -> unused
level
directory -> tables(1024) -> entries(1024)
frame
@ physical memory call
2.VFS and the initrd
VFS (virtual file system)
define the file loc, uid, and i_node link list
ex :
/usr/bin/
-> ./ls
/dev/tty/
initrd (initial ramdisk)
boot image loc
floop, disc, usb, ...
linux 0.0.1
http://kerneltrap.org/Linux/Dusting_Off_the_0.01_Kernel
http://www.cppblog.com/jake1036/archive/2010/11/13/133530.aspx
http://mapopa.blogspot.com/2010/07/error-bad-register-name-sil.html
http://manpages.ubuntu.com/manpages/gutsy/man1/as86.1.html
http://www.cppblog.com/jake1036/archive/2010/11/13/133530.aspx
JAME'S micro kernel
http://www.jamesmolloy.co.uk/tutorial_html/4.-The%20GDT%20and%20IDT.html
http://www.osdever.net/tutorials/index
http://en.wikipedia.org/wiki/Task_State_Segment
http://www.faqs.org/docs/Linux-HOWTO/KernelAnalysis-HOWTO.html#ss5.4
x86 instruction set
http://siyobik.info/index.php?module=x86
nasm
http://www.nasm.us/doc/nasmdoc0.html
沒有留言:
張貼留言