flat assembler
Message board for the users of flat assembler.

Index > OS Construction > What real mode memory can/can't I overwrite at bootup?

Author
Thread Post new topic Reply to topic
StringCheesian



Joined: 20 Feb 2004
Posts: 20
StringCheesian 20 Feb 2004, 18:56
Title says it all. I've got a working Hello World boot sector, now I want to make it load some more sectors but I don't know which memory is safe to overwrite...
Post 20 Feb 2004, 18:56
View user's profile Send private message Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon 20 Feb 2004, 19:33
0000:0000 - 0040:0000 = Interrupt Table (don't put code here)
0040:0000 - 0050:0000 = Bios Communication area(don't put code here)
0050:0000- 9000:FFFF = Data Area (Every thing here is free to put code)
07C0:0000 - 07c0:0200 = Boot up code(this is where your bootsector code is when you boot) it is also equal to 0000:7c00 - 0000:7e00
A000:0000 - FFFF:0010 = Video, option roms, BIOS (don't attempt to put code here, you WILL crash; there are parts you can write to however...)
A000:0000 - A000:FFFF = Video screen in graphical mode(put only screen pixel data here)
B800:0000 - B800:FFFF = Video screen in text mode(put only screen char data here)

This is your realmode memory map in the most basic form i can give during my short lunch break. When i get home from work, again, i will find you a more detailed resource.

_________________
It is better to be on the right side of the devil than in his path.
Post 20 Feb 2004, 19:33
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 20 Feb 2004, 20:15
Once you start using extended memory, you'll want to query the BIOS for special things like reserved addresses and memory holes... I can't remember the INTs for this, but it's probably documented somewhere easy to find - if all else fails, check linux kernel ^_^
Post 20 Feb 2004, 20:15
View user's profile Send private message Visit poster's website Reply with quote
StringCheesian



Joined: 20 Feb 2004
Posts: 20
StringCheesian 21 Feb 2004, 00:17
@asmdemon: Thanks!

@f0dder:
Well, that's a little over my head: I'm used to real mode asm. So I don't know much about the tables you have to set up and everything else you need to do before switching to pmode - it's a little intimidating (real mode is so much simpler)... any good tutorials on that, BTW?
Post 21 Feb 2004, 00:17
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 21 Feb 2004, 00:21
Well, if you stay with real mode code for a bit, and go with one of the standard memory maps, you should be safe I think. As for protected mode setup... this takes a bit of work Smile I'd suggest the intel systems programming manual (vol.3 of their IA32 docs, iirc), www.osdev.org, http://www.nondot.org/sabre/os/articles - that should get you (more than) started Smile
Post 21 Feb 2004, 00:21
View user's profile Send private message Visit poster's website Reply with quote
StringCheesian



Joined: 20 Feb 2004
Posts: 20
StringCheesian 21 Feb 2004, 10:03
wow, sweet link! Thanks!
Post 21 Feb 2004, 10:03
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.