accessing above 1mb longmode

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.
Post Reply
bear21
Posts: 4
Joined: Sun Aug 19, 2012 4:57 am

accessing above 1mb longmode

Post by bear21 »

Hi for some reason i can't find any thing talking about this.

i'm using my own stage1 bootloader, when i'm using the 'straight to long mode' example boot loader as a stage2, (then then calls my kernel) i'm not sure if it's how the example code sets it up or what not but;

My issue is when ever i try to access memory passed 0x100000 it ticks over back to 0, example if i was to read 0x007c00 or 0x107c00 or 0x207c00, it'd be the same result can reading/writing to 0x7c00,

my exact test code is:

Code: Select all

mov rax, 0x140000
mov rbx, 199
mov [rax], rbx
when i look at memory 0x140000 is null, and 0x040000 is 199

is the issue i'm having due to the setup from this code http://wiki.osdev.org/Entering_Long_Mode_Directly or something else i'm doing terribly wrong/ haven't done yet?

I'm sorry i'm pretty new to this and looking forward to your help!
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: accessing above 1mb longmode

Post by bluemoon »

It look like there is problem with your page directory content
bear21
Posts: 4
Joined: Sun Aug 19, 2012 4:57 am

Re: accessing above 1mb longmode

Post by bear21 »

fair enough, i was looking into it, ran out of hours to spend on it, knowing that that is the issue i'm good to spend a few more haha (i haven't changed what was in the longmode example at all but tweaking a few things had no effect at first, will go deeper)

thanks
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: accessing above 1mb longmode

Post by xenos »

Did you enable the A20 line?
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
bear21
Posts: 4
Joined: Sun Aug 19, 2012 4:57 am

Re: accessing above 1mb longmode

Post by bear21 »

XenOS wrote:Did you enable the A20 line?
omfg, it says it right there on the wiki page, well thanks for waking me up to my own retardedness, that was the issuem A20 enabled, working correctly now thank you very much *mov face, desk*
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: accessing above 1mb longmode

Post by xenos »

bear21 wrote:*mov face, desk*
It seems you're using Intel syntax, so I guess mov desk, face would be more convenient ;)
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
bear21
Posts: 4
Joined: Sun Aug 19, 2012 4:57 am

Re: accessing above 1mb longmode

Post by bear21 »

'sall reletive
gerryg400
Member
Member
Posts: 1801
Joined: Thu Mar 25, 2010 11:26 pm
Location: Melbourne, Australia

Re: accessing above 1mb longmode

Post by gerryg400 »

or

Code: Select all

   mov palm, %rax
   mov %rax, face
:)
If a trainstation is where trains stop, what is a workstation ?
Post Reply