Does Bochs Enable A20?

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
azurfire
Posts: 5
Joined: Sat Jul 26, 2008 1:29 pm

Does Bochs Enable A20?

Post by azurfire »

I had a nice, long post to make before accidently pressing a macro key on the side of my keyboard which was bound to F5. I really don't want to type it all again, so I'lll make this short:

Does Bochs enable A20 or is my code to check whether it is enabled flawed?

Code: Select all

PUSH DS
MOV BX, 0x0000
MOV DS, BX
MOV AX, [7DFEh]
MOV BX, 0xffff
MOV DS, BX
MOV BX, [7E0Eh]
POP DS
CMP AX, BX
JE OK
(It doesn't jump, so 0000:7DFE and FFFF:7E0E aren't equal)

I am testing A20 using the method here:
http://wiki.osdev.org/A20_Line

Thanks :)
User avatar
-m32
Member
Member
Posts: 120
Joined: Thu Feb 21, 2008 5:59 am
Location: Ottawa, Canada

Re: Does Bochs Enable A20?

Post by -m32 »

Yes, Bochs enables A20 - so, draw your own conclusions ;)
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Does Bochs Enable A20?

Post by bewing »

It is a little more correct to say that, in it's default config, bochs "sets" and ignores A20.

If you recompile bochs with a modified config file, then it will leave A20 unset and handle all A20 stuff -- but bochs has to check whether A20 is set or not on every single simulated mem access, so it runs much slower then.
User avatar
-m32
Member
Member
Posts: 120
Joined: Thu Feb 21, 2008 5:59 am
Location: Ottawa, Canada

Re: Does Bochs Enable A20?

Post by -m32 »

Whoops... I'm not paying attention today... i read and even typed "Bochs", but was thinking of Grub :oops:
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: Does Bochs Enable A20?

Post by Korona »

GRUB also sets the A20 flag.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Does Bochs Enable A20?

Post by jal »

Korona wrote:GRUB also sets the A20 flag.
In fact, it must, because it loads your kernel above 1MB (or at, to be precise).


JAL
xlq
Member
Member
Posts: 36
Joined: Mon Dec 11, 2006 7:51 am

Re: Does Bochs Enable A20?

Post by xlq »

Grub loads your kernel to whatever address is specified in the multiboot header, which must be no lower than 1 MiB. (Most people choose to link and load their kernel at 1 MiB for convenience though)
Post Reply