1
0
mirror of https://github.com/0xAX/linux-insides.git synced 2024-12-22 14:48:08 +00:00
Go to file
fuzhli 148226b922 correct the CS:IP presentation for reset vector in 80386
I think the author may need introduce the Intel processor's segment
register change from 16-bit processor to 32-bit processor. In 16-bit
processor, the CS register's value is the (segment offset)/16; while in the
32-bit processor, the CS register is still a 16-bit register, but its
value is just a index of the GDT.

In 32-bit mode, I think we can use 0xf000:0xfff0 to present the reset
vector because the CS's value is 0xf000 and IP's value is 0xfff0.

To keep with the 16-bit processor's presentation, we can also use the
0x0ffff000:0xfff0, because the CS segment offset is 0xffff000 and we can
calculate the segment's selector by (0xffff0000)/16.

In http://en.wikipedia.org/wiki/Reset_vector , it said that "The reset vector for the 80386 and later x86 processors is physical linear address FFFFFFF0h. The value of the selector portion of the CS register at reset is F000h, the value of the base portion of the CS register is FFFF0000h, and the value of the IP register at reset is FFF0h to form the segmented address FFFFF000h:FFF0h in real mode.", so it should be 0xffff000:0xfff0.

I also check the <<Intel® 64 and IA-32 Architectures Software Developer’s Manual Volume 3A: System Programming Guide, Part 1>>, in section 9.1.4 "First Instruction Excuted",  it said that "The first time the CS register is loaded with a new value after a hardware reset, the processor will follow the normal rule for address translation in real-address mode (that is, [CS base address = CS segment selector * 16]).". So in real mode, the CS base is 0xffff0000, the CS segment selector should be treated as (CS base)/16, which is 0x0ffff000.
2015-01-05 16:37:18 +08:00
CONTRIBUTING.md Added new step :) 2015-01-05 12:33:17 +05:30
contributors.md @akash0x53 added to contributors.md 2015-01-05 12:56:31 +06:00
linux-bootstrap-1.md correct the CS:IP presentation for reset vector in 80386 2015-01-05 16:37:18 +08:00
README.md README.md updated 2015-01-05 00:04:23 +06:00

linux-internals

Series of posts about linux kernel.

Goal is simple - to share my modest knowledge about linux kernel internals and help people who interested in low-level stuff and linux kernel as me.

Questions/Suggestions: Feel free about any questions or suggestsions by pinging me at twitter @0xAX, adding issue or just drop me email.

Contributions: Feel free to create issues if my English is too bad or create pull-requests.

Please read CONTRIBUTING.md before you pushed your chanages.

Author

@0xAX