flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
a115433
how can i switch to long mode?
i need page in manual - sorry, cant find it myself. ...and im not interested in switching directly from real mode. |
|||
![]() |
|
zhak
http://flatassembler.net/examples/longmode.zip - example by Tomasz
btw, don't forget that google is your friend ![]() |
|||
![]() |
|
a115433
thx. can i use PSE to get only 1 plm4 table with 1 giga page?
just to make it easy for testing. |
|||
![]() |
|
cod3b453
You should check CPUID 0x80000001 EDX[26] is set. (see AMD Vol 2 #24593 Section 5.3 pp. 128-)
Also, it's a good idea to map the first 4GB, especially if you're using VESA. |
|||
![]() |
|
a115433
; number of pages to map (1 MB)
bullshit. manual cant agree with you, its 4kilo page. PDPTE PS = 1 giga PDE PS = 2 mega PTE = 4 kilo ia32e doesnt support 1 mega |
|||
![]() |
|
a115433
i think i understand it now.
all structures are same. PS indicate if page is mapped, or next entry. 4 kilo and 2 mega - done. 1 giga - doesnt work. affffff this manual is such a pain in the ass. |
|||
![]() |
|
cod3b453
What it means is the longmode example given maps 1MB by creating 256 4kB pages = 1024kB mapped memory.
To get 1GB pages you simply add the direct aligned mappings to PDPE instead. e.g. Code: xor edx,edx mov eax,10000011b mov [0x0000000000071000],eax ; (NX bit 63), 1st GB, direct map bit 7, Writeable bit 2, present bit 1 mov [0x0000000000071004],edx |
|||
![]() |
|
a115433
Code: mov dword [0x70000],0x71000 + 3 ;PDPTE mov dword [0x70004],0 ;PDPTE ;mov dword [0x71000],0x72000 + 3 ; PDE ;mov dword [0x71004],0 ;mov dword [0x72000],0x73000 + 3 ; PTE ;mov dword [0x72004],0 ; PTE ;mov dword [0x72000],10000011b ;mov dword [0x72004],0 mov dword [0x71000],10000011b mov dword [0x71004],0 what is wrong? when i enable 2 mega entry - uit works. 4 kilo - also work. 1 giga - exception (i dont have idt). bochs support 1gb page, i used cpuid. |
|||
![]() |
|
cod3b453
You might need to set bit 12 as well - try using 0001000010000011b instead
|
|||
![]() |
|
a115433
doesnt work
![]() |
|||
![]() |
|
narada
if Done(a115433.1Gb_page) then
begin a115433.Please.zipAndPost("source_done.zip") end; WriteLn('Thank you'); |
|||
![]() |
|
smiddy
LOL
|
|||
![]() |
|
a115433
ok i post if you want, but i cant make it fork for unknown reason.
i really dont know why 1 GB page doesnt work! |
|||
![]() |
|
baldr
a115433,
Check Bochs log to be sure that 1G paging support: yes. It appears to be compile-time option, default: no. |
|||
![]() |
|
a115433
1G paging support: no
thx. but cpuid show that it support it. ok nvm, do you know where will i get version with 1G page support? or i will use virtualbox to test 1G pages, im simply unable to compile it. |
|||
![]() |
|
revolution
a115433 wrote: affffff this manual is such a pain in the ass. ![]() |
|||
![]() |
|
baldr
a115433,
I've compiled Bochs 2.4.2 with #define BX_SUPPORT_1G_PAGES 1, though too many 64->32 conversion warnings were issued. It looks suspicious. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.