X86 Booting Sequence

时间:2014-05-04 19:38:42   收藏:0   阅读:513

1.BIOS

Beep Error Message
1 short POST OK!
1 long Memory problem
1 long, 2 short Video card error
1 long, 3 short No video card or bad video RAM
Repeating beeps Memory error
High Frequency beeps Overheating CPU
For more information, visit Phoenix Tech - Award Error Codes.
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣
bubuko.com,布布扣 Image Source: Wikipedia - Cylinder-head-sector

 


bubuko.com,布布扣 

 

HelpPC Reference Library

	0x0000:0	Interrupt Vector Table
	0x0040:0	BIOS Data Area
	0x0050:0	PrtScr Status / Unused
	0x0060:0	Image Load Address
	0x07C0:0	Boot code is loaded here at startup (31k mark)
	0xA000:0	EGA/VGA RAM for graphics display mode 0Dh & above
	0xB000:0	MDA RAM, Hercules graphics display RAM
	0xB800:0	CGA display RAM
	0xC000:0	EGA/VGA BIOS ROM (thru C7FF)
	0xC400:0	Video adapter ROM space
	0xC600:0 256 B	PGA communication area
	0xC800:0  16 KB	Hard disk adapter BIOS ROM
	0xC800:5	XT Hard disk ROM format, AH=Drive, AL=Interleave
	0xD000:0  32 KB	Cluster adapter BIOS ROM
	0xD800:0	PCjr conventionalsoftware cartridge address
	0xE000:0  64 KB	Expansion ROM space (hardwired on AT+)
		 128 KB	PS/2 System ROM (thru F000)
	0xF000:0	System monitor ROM
			PCjr: software cartridge override address
	0xF400:0	System expansion ROMs
	0xF600:0	IBM ROM BASIC (AT)
	0xF800:0	PCjr software cartridge override address
	0xFC00:0	BIOS ROM
	0xFF00:0	System ROM
	0xFFA6:E	ROM graphics character table
	0xFFFF:0	ROM bootstrap code
	0xFFFF:5   8 B	ROM date (not applicable for all clones)
	0xFFFF:E   1 B	ROM machine id


 

	+--------+----------------------------------------------------+
	| OFFSET | 0  1  2  3   4  5  6  7   8  9  A  B   C  D  E  F  |
	+--------+----------------------------------------------------+
	| 0x0000 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0010 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0020 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0030 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0040 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0050 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0060 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	             0x0070 - 0x015F 也都是 CC 故省略
	~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	| 0x0160 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0170 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0180 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x0190 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x01a0 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC CC CC |
	| 0x01b0 | CC CC CC CC  CC CC CC CC  CC CC CC CC  CC CC P1 P1 |
	| 0x01c0 | P1 P1 P1 P1  P1 P1 P1 P1  P1 P1 P1 P1  P1 P1 P2 P2 |
	| 0x01d0 | P2 P2 P2 P2  P2 P2 P2 P2  P2 P2 P2 P2  P2 P2 P3 P3 |
	| 0x01e0 | P3 P3 P3 P3  P3 P3 P3 P3  P3 P3 P3 P3  P3 P3 P4 P4 |
	| 0x01f0 | P4 P4 P4 P4  P4 P4 P4 P4  P4 P4 P4 P4  P4 P4 55 AA |
	+--------+----------------------------------------------------+
	CC:   0x0000 to 0x01BD - Boot loader code (First 446 bytes)
	P1:   0x01BE to 0x01CD - Partition entry 1
	P2:   0x01CE to 0x01DD - Partition entry 2
	P3:   0x01DE to 0x01ED - Partition entry 3
	P4:   0x01EE to 0x01FD - Partition entry 4
	55AA: 0x01FE to 0x01FF - Boot signature
	+------------+----+-----------+----+-----------+--------------+---------------+
	|   Byte     | 0  |  1  2  3  | 4  |  5  6  7  |  8  9  A  B  |  C  D  E  F   |
	+------------+----+-----------+----+-----------+--------------+---------------+
	| Descrption | BI | Start HCS | FD |  End HCS  | Start Sector | Num of Sector |
	+------------+----+-----------+----+-----------+--------------+---------------+
	BI            (1): Boot indicator (0x00 off, 0x80 on)
	Start HCS     (3): Starting head, cylinder and sector
	FD            (1): Filesystem descriptor
	End HCS       (3): Ending head, cylinder and sector
	Start Sector  (4): Starting sector (offset to disk start)
	Num of Sector (4): Number of sectors in partition


bubuko.com,布布扣 bubuko.com,布布扣 Image Source: Thinker: FreeBSD 開機流程
bubuko.com,布布扣 Image Source: Linux Journal - Booting the Kernel

 

 

INT (Hex)
IRQ
Common Uses
00 - 01
Exception Handlers
00: Division by Zero; 01: Single Step
02
Non-Maskable IRQ
Non-Maskable IRQ (Parity Errors)
03 - 07
Exception Handlers
03: Breakpoint; 04: Overflow; 05: Hardcopy
08
Hardware IRQ0
System Timer
09
Hardware IRQ1
Keyboard
0A
Hardware IRQ2
Redirected
0B
Hardware IRQ3
Serial Comms. COM2/COM4
0C
Hardware IRQ4
Serial Comms. COM1/COM3
0D
Hardware IRQ5
Reserved/Sound Card
0E
Hardware IRQ6
Floppy Disk Controller
0F
Hardware IRQ7
Parallel Comms.
10 - 6F
Software Interrupts
-
70
Hardware IRQ8
Real Time Clock
71
Hardware IRQ9
Redirected IRQ2
72
Hardware IRQ10
Reserved
73
Hardware IRQ11
Reserved
74
Hardware IRQ12
PS/2 Mouse
75
Hardware IRQ13
Math‘s Co-Processor
76
Hardware IRQ14
Hard Disk Drive
77
Hardware IRQ15
Reserved
78 - FF
Software Interrupts
-
(00 - 1F: BIOS Functions; 20 - 3F: DOS Functions; 60 - 67: User Software Interrupts; 80 - F0: BASIC Interrupts; F1 - FF: Unused)


	mov	al, 0x20
	out	0xA0, al


 

1. app1 running...
2. interrupt
3. context switch from app1 to kernel
4. kernel scheduler pick next application to run
5. context switch form kernel to app1
6. interrupt return
7. app2 running...

 

Understanding the FAT32 Filesystem

 

文件

 

X86 Booting Sequence,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!