Page 1 of 1 [ 4 posts ] 

kmalloc
Hummingbird
Hummingbird

User avatar

Joined: 10 Dec 2013
Age: 35
Gender: Male
Posts: 21

08 Feb 2014, 3:31 am

I want to start out in real mode, before I get into protected mode. Is the offset the interrupt vector that get's
multiplied by four? I think I'm confused.



Cornflake
Administrator
Administrator

User avatar

Joined: 30 Oct 2010
Gender: Male
Posts: 73,326
Location: Over there

08 Feb 2014, 8:14 am

All x86 CPUs start in real mode when reset. Also, the offset part of a real mode address is not an interrupt vector.
http://en.wikipedia.org/wiki/X86_assemb ... tion_modes
See also (scroll down to the "Real Mode" header):
http://www.codeproject.com/Articles/457 ... torial-for


_________________
Giraffe: a ruminant with a view.


kmalloc
Hummingbird
Hummingbird

User avatar

Joined: 10 Dec 2013
Age: 35
Gender: Male
Posts: 21

09 Feb 2014, 6:11 pm

If it's not the interrupt vector, then what is the offset?



Cornflake
Administrator
Administrator

User avatar

Joined: 30 Oct 2010
Gender: Male
Posts: 73,326
Location: Over there

09 Feb 2014, 7:17 pm

Real mode addressing doesn't access memory as a linear, contiguous block - it's segmented, so a memory location is accessed by two parts: a segment and the offset within it.
The links I gave above, and others, explain how it works - check out the segment registers and how they're used to access memory.

If you're referring to an offset into the vector table to grab/plant specific destination addresses then yes, it's *4 because each address in the table is 4 bytes long (seg:ofs).
But this offset is just an offset into a table - it's not the same thing as the offset in real mode memory addressing.
http://wiki.osdev.org/Interrupt_Vector_Table


_________________
Giraffe: a ruminant with a view.