0x7C00

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
rty
Posts:6
Joined:Fri Apr 03, 2009 12:48 am
0x7C00

Post by rty » Fri Apr 03, 2009 10:09 pm

Hi, im new to the forum, nice work writing the OS Dev tutorial Mike, and thanks.
Im quite new to assembly, usually I write in c/c++ and script based languages.

From the tutorial
"The BIOS loads us at 0x7C00"

From the NASM manual
"The function of the ORG directive is to specify the origin address which NASM will assume the program begins at when it is loaded into memory"
"Its sole function is to specify one offset which is added to all internal address references within the section"

1: Does the BIOS load the program/boot-loader into the RAM memory?

2: Why do you load the program/boot-loader at 0x7C00?

3: Does NASM differenciate between absolute and segment:offset by they way they are i.e.
org 0x7C00 and org 0007:7B90


rty

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: 0x7C00

Post by Mike » Fri Apr 03, 2009 11:50 pm

rty wrote:1: Does the BIOS load the program/boot-loader into the RAM memory?
Yes.
rty wrote:2: Why do you load the program/boot-loader at 0x7C00?
We do not load it to 0x7c00, the BIOS does. There is no specific reason why 0x7c00, it has became a standard loading address for most, if not all, BIOS software.
rty wrote:3: Does NASM differenciate between absolute and segment:offset by they way they are i.e.
org 0x7C00 and org 0007:7B90
It does. Absolute addresses are linear addresses. You can think of a linear address as a 32 bit offset address, without the segment. Linear addresses are a different memory addressing model then segment:offset addressing.
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com

rty
Posts:6
Joined:Fri Apr 03, 2009 12:48 am

Re: 0x7C00

Post by rty » Sat Apr 04, 2009 3:03 am

Thanks Mike.
I understand most of that, but I think I wanna learn more about memory models before I get lost.
At the moment im reading intel manuals, this should help understand processors a bit more.
Intel® 64 and IA-32 Architectures Software Developer's Manual Volume 1: Basic Architecture

Ive got a lot to learn.. assembly in NASM aswell.. :shock:


rty

User avatar
Mike
Site Admin
Posts:465
Joined:Sat Oct 20, 2007 7:58 pm
Contact:

Re: 0x7C00

Post by Mike » Sat Apr 04, 2009 3:45 am

Hello,

Tutorial 4 (search for "Segment:Offset Memory Mode - History" section). This portion of the tutorial contains alot of information on segment:offset addressing.

Tutorial 8 (search for "PMode Memory Addressing" section). This portion of the tutorial covers the descriptor:linear addressing mode used in protected mode.

These might help out a little along with your copy of the Intel manuals :)
Lead Programmer for BrokenThorn Entertainment, Co.
Website: http://www.brokenthorn.com
Email: webmaster@brokenthorn.com

rty
Posts:6
Joined:Fri Apr 03, 2009 12:48 am

Re: 0x7C00

Post by rty » Sun Apr 05, 2009 5:01 am

Thanks again Mike.

My head is burning with all the information.
I know a bit more about the Memory Models, Flat, Segmented, and Real-Address mode.
And the different ways the processor accesses memory, Linear Addresses and Logical Addresses(segment:offset).

I saw the descriptor tables in Tutorial 8.. :|
I dont know what they are yet, but I see how vital they are.
Ill be reading Tutorial 8: World of Protected Mode completely, and AoA 4.0: Memory layout and access next.

Im kinda sliding off topic here..


rty

Post Reply