Prev: NASM HelloWorld - DOS
Next: ELF loading
From: Frank Kotler on 14 Aug 2007 15:54 opexoc(a)gmail.com wrote: > On 14 Sie, 14:46, Frank Kotler <fbkot...(a)verizon.net> wrote: > > >>>Another question: Is it really necessary to enable A20 line to enter >>>PM? >> >>If you want to access "odd megabytes", yeah. > > > Actually, why "odd megabytes"? Why A20 line decide if odd megabytes > are available? Google for "a20 - a pain from the past"... I'll save you the trouble: http://www.win.tue.nl/~aeb/linux/kbd/A20.html Best, Frank
From: opexoc on 14 Aug 2007 16:49 On 14 Sie, 21:54, Frank Kotler <fbkot...(a)verizon.net> wrote: > Google for "a20 - a pain from the past"... I'll save you the trouble: > > http://www.win.tue.nl/~aeb/linux/kbd/A20.html Thanks for this link but I don't find there explanation why A20 line is responsible for access odd megabytes. Wiktor
From: James Harris on 14 Aug 2007 17:24 On Aug 14, 9:49 pm, ope...(a)gmail.com wrote: > On 14 Sie, 21:54, Frank Kotler <fbkot...(a)verizon.net> wrote: > > > Google for "a20 - a pain from the past"... I'll save you the trouble: > > >http://www.win.tue.nl/~aeb/linux/kbd/A20.html > > Thanks for this link but I don't find there explanation why A20 line > is responsible for access odd megabytes. It's not written to answer your question specifically but does this help: http://aodfaq.wikispaces.com/#tochome28
From: SpooK on 14 Aug 2007 17:29 On Aug 14, 3:49 pm, ope...(a)gmail.com wrote: > On 14 Sie, 21:54, Frank Kotler <fbkot...(a)verizon.net> wrote: > > > Google for "a20 - a pain from the past"... I'll save you the trouble: > > >http://www.win.tue.nl/~aeb/linux/kbd/A20.html > > Thanks for this link but I don't find there explanation why A20 line > is responsible for access odd megabytes. > > Wiktor It is called the "A20" line because it is the 20th Addressing Line and using your powers of binary you can conclude that 2^20 = 1MB. This is a kick-back of the legacy need to wrap addresses above 1MB back around to 0 in 16-bit Real Mode apps. 32-bit Protected Mode obviously uses more addressing lines, however, due to the design of the x86, the A20 line still needs to be enabled in order for the addressing mechanism to acknowledge (not ignore) that line/bit and thus allow access to the odd megabytes. If you still are confused, give me an example of how you would determine if a number in EAX is odd or even ;)
From: Wolfgang Kern on 15 Aug 2007 12:12
opexoc asked: .... mov eax, cr0 or eax, 1 mov cr0, eax ;[BITS 32] jmp 08h:clear_pipe ;Jump to code segment, offset ;[BITS 32] clear_pipe: [BITS 32] ;I'd put it here because the label is still 16 bit! mov ax, 10h ;LOAD data segment register with segment desriptor mov ds, ax > In which location directive [BITS 32] should appear > first or second )? After the jump of course, because CS is loaded by the FAR jump and exactly there occure the mode-transition. If the distance of clear_pipe is beyond 16 bit limits, or if the clear_pipe is already defined as a 32-bit label, then you should either have the [bits 32] before the label, or manually extend the jump by an '66h'-prefix and the two more bytes in the offset. Not sure if your tool will handle this by itself, the produced code should then look like: 66 EA xx xx xx xx 08 00 JMPF 0008: xxxxxxxxh [BITS 32] after the jump where 'x' mean a 32-bit address offset, or the jump after [BITS 32]: EA xx xx xx xx 08 00 > When I use first location then computer hang on and doesn't > execute properly code in clear_pipe. Sure. And without the far jump you may have just entered "BIG-real mode". __ wolfgang |