EPROM confusion

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

EPROM confusion

Post by Zacariaz »

[quote="'Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide'"]9.7.1 Real-Address Mode IDT

In real-address mode, the only system data structure that must be loaded into memory is the IDT (also called the “interrupt vector tableâ€
Aali
Member
Member
Posts: 58
Joined: Sat Apr 14, 2007 12:13 pm

Post by Aali »

all that says is that the code doesn't have to be in RAM, it could be BIOS code or whatever

it doesn't mean you should put *your* code in EPROM
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Freenode IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

It describes that in real mode you need to set up an interrupt table (the "real mode IDT"/ IVT).

Furthermore, the interrupt handlers must be within the 1MB limit of real mode where the processor can access it, and that it can be located on any form of memory (either RAM or ROM).

What it does not say is that the code and hardware responsible for doing this is implemented in the PC BIOS. When the computer boots, it will create the IVT and will set all the pointers to the appropriate interrupt handlers. Since the bios is contained in ROM mapped to 0xf0000-0xfffff, it conforms to all the requirements the documentation states.

It also means that you do not have to worry about setting up the IVT or about (EP)ROM.

Common sense tells us not to write to the bios area, as things are stored there that are beyond the average human's comprehension which also happen to be required for the computer to work properly.

so for the bios rom, pros: nice area for showing off 1337 skills, cons: one mistake and your box is braindead.

You could add another rom chip into an x86 system, but that's a different subject and requires quite a bit more arcane knowledge to make it work.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

Combuster wrote:What it does not say is that the code and hardware responsible for doing this is implemented in the PC BIOS. When the computer boots, it will create the IVT and will set all the pointers to the appropriate interrupt handlers. Since the bios is contained in ROM mapped to 0xf0000-0xfffff, it conforms to all the requirements the documentation states.

It also means that you do not have to worry about setting up the IVT or about (EP)ROM.

Thats more or less what i thought would be the answer, but better be on the safe side when trying to understand this rather complicated stuff.

Thanks
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

This is "OS Design & Theory". Please post this type of question in "OS Development" next time.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Freenode IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Colonel Kernel wrote:This is "OS Design & Theory". Please post this type of question in "OS Development" next time.

Are you sure about that? This looks like "OS Development".. Although it seems chase made a duplicate? or a mirror? :roll:
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

This thread has been moved, objection withdrawn. :)
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

Colonel Kernel wrote:This is "OS Design & Theory". Please post this type of question in "OS Development" next time.

pardon me, but what should i post in "OS Design and Theory" then?
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Post by Colonel Kernel »

Zacariaz wrote:
Colonel Kernel wrote:This is "OS Design & Theory". Please post this type of question in "OS Development" next time.

pardon me, but what should i post in "OS Design and Theory" then?


Ideas about design and theory, not questions about hardware and implementation details. Read some of the other posts in "OS Design & Theory" to get an idea.

An example of a good question for Design & Theory: "Should I use a microkernel or monolithic architecture for my OS?" An example of a bad question for Design & Theory: "How do I set up the page tables so that my kernel is mapped in the higher half?"

Does this help?
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

k, i get the point, but would still classify my question as theory.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Freenode IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Zacariaz wrote:k, i get the point, but would still classify my question as theory.

I agree. The question was a corner case and could've gone to either development and theory. It was the answer that made it a purely practical affair.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US
Contact:

Post by bewing »

Zacariaz wrote: I any case, what would the pros and cons be to using EPROM as suggested?


I'm not seeing a specific answer to this question in the replies, so far, I don't think. So here's the answer as best I know.

The statement you quoted in the Intel manual is aimed at motherboard manufacturers, not programmers or OS developers. As an OS developer, the use of ROM is hidden from you. You cannot access it directly. You cannot do anything with it, if it is there. The BIOS is what gets stored in that ROM, and is usually "shadowed" into your computer's RAM at physical address 0xF0000 to 0xFFFFF. Your OS probably can't, and probably shouldn't (assuming it can) even turn the shadowing off.
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

The word "software" in: 'Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide'
is what made it confusing, but i get it now.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Freenode IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

Zacariaz wrote:The word "software" in: 'Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 3A: System Programming Guide'
is what made it confusing, but i get it now.

The BIOS is also a piece of software :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

sure it is, but if you are gonna program a bios, syrely you need more info than whats in the intel manual... or?
Post Reply