blob: eba076cb97d6c3e15a42d99ad5e8a1087e3d8355 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
Welcome to FoolOS
=================
Copyright M.Idziorek 2014 <m.i@gmx.at>
NOTES
=====
cli; disable interrupts
lgdt
lidt
sti; enable interrupts
Linux Startup x86
=================
1. arch/x86/boot/header.S
Contains the header and linux 16 bit code.
This code should be entered with a bootloader at the address specified
within the header (as _start) which will put us at 'start_of_setup'
Direct loading will put us at 'start2' at the very start which will
show an error message
If everyhing goes right we will enter the 16-bit real mode C module
with:
call main ; should not return
2. arch/x86/boot/main.c
void main(void) will do some checks and detections (cpu,mem,..) and
invoke: go_to_protected_mode();
3. arch/x86/boot/pm.c
go_to_protected_mode() - will disable interrupts and set up the initial
idt and gdt descriptor tables before calling: protected_mode_jump() and
passing the address of code32_start.
4. arch/x86/boot/pmjump.S
back in assembly-world the actual transition is made inside
'protected_mode_jump' and we move on to 'in_pm32' where the data segment
is set up and we jmpl to the 32-bit entry point of the kernel.
5. arch/x86/kernel/head32.c (assumption!?)
void i386_start_kernel(void)
6. init/main.c
start_kernel(void)
setup_arch()!!
Interrupts
==========
arch/x86/include/asm/irq_vectors.h each entry is 8 bytes
ISA interrupts:
0x30 0x0000 0x0000 0x0000 0x0000
0x31
0x32
..
0x3f
|