flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly 16 Feb 2007, 02:31
In fact you need no more than 16 MB (15728640/1024^2). The code is correct but it requires protected mode (or unreal mode) and some code that sets DS with a descriptor with full access to the 4 GB address space. There are lots of these codes on OS construction subforum. The sources of FASM (SOURCE\DOS) has code that enters to this unreal mode too.
|
|||
![]() |
|
Dex4u 16 Feb 2007, 16:27
Something like this would work:
Code: ;************************************; Pmode, by Dex; Assemble with fasm; c:\fasm Pmode.asm Pmode.com;************************************org 0x100use16;****************************; Realmode startup code.;****************************start: xor ax,ax mov ds,ax mov es,ax;****************************; enable A20 line;**************************** pusha cli ; Disable all irqs cld mov al,255 ; Mask all irqs out 0xa1,al out 0x21,all.5: in al,0x64 ; Enable A20 test al,2 ; Test the buffer full flag jnz l.5 ; Loop until buffer is empty mov al,0xD1 ; Keyboard: write to output port out 0x64,al ; Output command to keyboardl.6: in al,0x64 test al,2 jnz l.6 ; Wait 'till buffer is empty again mov al,0xDF ; keyboard: set A20 out 0x60,al ; Send it to the keyboard controller mov cx,14hl.7: ; this is approx. a 25uS delay to wait out 0edh,ax ; for the kb controler to execute our loop l.7 ; command. sti popa;*****************************; Setting up, to enter pmode.;***************************** cli lgdt [gdtr] mov eax, cr0 or al,0x1 mov cr0,eax jmp 0x10: protected;*****************************; Pmode. Note: you should assemble the above code as a com file and run it from dos, but it will not return to Dos. If you want to return to Dos, you can use some of this demo: http://www.dex4u.com/tuts/DemoVesa.zip |
|||
![]() |
|
fafastrungen 16 Feb 2007, 20:03
Thanks for the answers.
I forgot to say that I use an AMD64, so the real mode and segmentation is not necesary. I don't need compatibility with 32 bits, I just want to do this only for 64 bits. |
|||
![]() |
|
Dex4u 17 Feb 2007, 17:11
Then you should look here:
http://board.flatassembler.net/topic.php?t=6206 |
|||
![]() |
|
fafastrungen 17 Feb 2007, 23:00
Dex4u wrote: Then you should look here: Perfect, this is what I was looking for. thanks. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.