Offset?

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

Moderator: Moderators

Post Reply
Developer
Posts: 37
Joined: Sun May 30, 2010 4:30 pm

Offset?

Post by Developer » Fri Aug 06, 2010 11:17 am

Hi,

What does "Offset" mean?
Can somebody explain that in-depth,
and give me more details. Thanks!

Bye

Andyhhp
Moderator
Posts: 387
Joined: Tue Oct 23, 2007 10:05 am
Location: 127.0.0.1
Contact:

Re: Offset?

Post by Andyhhp » Fri Aug 06, 2010 8:28 pm

Depends. Can you give the context in which you found it? (code example or so)

There is more than 1 meaning which I can think of, depending on context.

~Andrew
Image

Jarvix
Posts: 21
Joined: Mon Apr 06, 2009 6:08 am

Re: Offset?

Post by Jarvix » Sat Aug 07, 2010 10:42 am

"Offset" says the value is relative.

If you have point A at 20px horizontal, and point B at 30px, then offset of B (to A) would be 10px.

Thats the general idea.

// Jarvix
Jinix. Kernel programming is a black art that should be avoided if at all possible.

Developer
Posts: 37
Joined: Sun May 30, 2010 4:30 pm

Re: Offset?

Post by Developer » Tue Aug 10, 2010 1:45 pm

Andyhhp wrote:Depends. Can you give the context in which you found it? (code example or so)

There is more than 1 meaning which I can think of, depending on context.

~Andrew
Hi Andrew:

I got it from this page:
http://www.brokenthorn.com/Resources/OSDev4.html

We can convert the above to the absolute address 0x7C00 by using our formula:
base address = base address * segment size (16) + offset
07C0:0000 = 07C0 * 16 (decimal) + 0
= 07C00 + 0 = 0x7C00

Can you explain this in details, I really want to learn. Thanks!

Developer
Posts: 37
Joined: Sun May 30, 2010 4:30 pm

Re: Offset?

Post by Developer » Tue Aug 10, 2010 1:45 pm

Jarvix wrote:"Offset" says the value is relative.

If you have point A at 20px horizontal, and point B at 30px, then offset of B (to A) would be 10px.

Thats the general idea.

// Jarvix
Is it junk memory?

Andyhhp
Moderator
Posts: 387
Joined: Tue Oct 23, 2007 10:05 am
Location: 127.0.0.1
Contact:

Re: Offset?

Post by Andyhhp » Tue Aug 10, 2010 2:04 pm

Can you explain this in detail
Real mode (16bit mode) addressing works using the Segment:Offset method.

Both segment and offset are two numbers.

In this case, offset is just a name for a number. Im not sure how else to describe it.

In the case that you gave, the segment value was 0x7C0 and the offset value was 0

That means that the linear address pointed to by the segment:offset pair was 0x7C00 because of the rule for converting a segment:offset pair to a linear address.

~Andrew
Image

Developer
Posts: 37
Joined: Sun May 30, 2010 4:30 pm

Re: Offset?

Post by Developer » Tue Aug 10, 2010 2:17 pm

Andyhhp wrote:
Can you explain this in detail
Real mode (16bit mode) addressing works using the Segment:Offset method.

Both segment and offset are two numbers.

In this case, offset is just a name for a number. Im not sure how else to describe it.

In the case that you gave, the segment value was 0x7C0 and the offset value was 0

That means that the linear address pointed to by the segment:offset pair was 0x7C00 because of the rule for converting a segment:offset pair to a linear address.

~Andrew
So that means between 0 and 0x7c00 is the offset segmentation.
Or am I wrong??

Andyhhp
Moderator
Posts: 387
Joined: Tue Oct 23, 2007 10:05 am
Location: 127.0.0.1
Contact:

Re: Offset?

Post by Andyhhp » Tue Aug 10, 2010 2:24 pm

Nope.

I have no idea where you got "offset segmentation" from but its really confusing matters.

The Offset is a number, and the Segment is a number. 'Offset' and 'Segment' are just names for numbers, in the same way you might use x or y in algebra.

~Andrew
Image

Developer
Posts: 37
Joined: Sun May 30, 2010 4:30 pm

Re: Offset?

Post by Developer » Thu Aug 12, 2010 1:28 pm

Andyhhp wrote:Nope.

I have no idea where you got "offset segmentation" from but its really confusing matters.

The Offset is a number, and the Segment is a number. 'Offset' and 'Segment' are just names for numbers, in the same way you might use x or y in algebra.

~Andrew
Please do NOT feel offended, but can you give me more details?
Where is Mike?

Andyhhp
Moderator
Posts: 387
Joined: Tue Oct 23, 2007 10:05 am
Location: 127.0.0.1
Contact:

Re: Offset?

Post by Andyhhp » Thu Aug 12, 2010 1:46 pm

Is english your first language?
Image

Developer
Posts: 37
Joined: Sun May 30, 2010 4:30 pm

Re: Offset?

Post by Developer » Thu Aug 12, 2010 1:47 pm

Andyhhp wrote:Is english your first language?
Why are you asking such question?

Andyhhp
Moderator
Posts: 387
Joined: Tue Oct 23, 2007 10:05 am
Location: 127.0.0.1
Contact:

Re: Offset?

Post by Andyhhp » Thu Aug 12, 2010 1:53 pm

Because your questions are not making logical sense.

You asked "what does offset mean" and had two answers. One for the question "what does the word offset mean" and one for the question "what does the offset in this specific case mean".

The fact that you are still asking the same origininal question probably means that english is not your first language
Image

Developer
Posts: 37
Joined: Sun May 30, 2010 4:30 pm

Re: Offset?

Post by Developer » Thu Aug 12, 2010 1:56 pm

Andyhhp wrote:Because your questions are not making logical sense.

You asked "what does offset mean" and had two answers. One for the question "what does the word offset mean" and one for the question "what does the offset in this specific case mean".

The fact that you are still asking the same origininal question probably means that english is not your first language
No no, the fact is that I want more in-depth details. That's one of the reasons
why I asked.

Post Reply