flat assembler
Message board for the users of flat assembler.
Index
> DOS > problem with unREAL mode fasm Goto page Previous 1, 2, 3, 4, 5 Next |
Author |
|
vid 10 Jan 2008, 00:09
DOS386 wrote:
in pure dos? eg. without extender? Last edited by vid on 10 Jan 2008, 00:28; edited 1 time in total |
|||
10 Jan 2008, 00:09 |
|
edfed 10 Jan 2008, 00:26
erf, evidentlly with extender now, because there isn't possibility to use it in PURE DOS mode..
playing with words don't help anybody, or it's humoristic... now, with the extender, it works very well. but, the extender is just a msdos program, installable and uninstallable. os yes, i use it in pure dos mode, now, with extender, before, with bugss. the command line version is the one who works everywhere...but not under visthhhhaaa |
|||
10 Jan 2008, 00:26 |
|
DOS386 10 Jan 2008, 01:26
> in pure dos? eg. without extender?
YES, in pure DOS without Windaube and with a DPMI host > because there isn't possibility to use it in PURE DOS mode.. I have pure DOS mode - but FASMD and many other useful apps run using DPMI rather than in real mode > extender is just a msdos program And "msdos" is dead > with extender, before, with bugss. > is the one who works everywhere...but not under visthhhhaaa Very true |
|||
10 Jan 2008, 01:26 |
|
rugxulo 25 Jan 2008, 05:27
I don't see the huge issue with dropping unreal mode if necessary, but it's indeed a cool hack. (I normally have JEMM386 loaded, which provides UMBs, so actually I'd suggest lh cwsdpmi -p or lh hdpmi32 -r instead).
Maybe we all need to optimize FASM for size (sort of a coding competition, heh). BTW, the latest testing r6 of CWSDPMI is recommended over r5 if you want access to huge amounts of RAM: Charles W. Sandmann wrote:
download: csdpmi6t.zip notes collected by me from Google Groups: csdpmi6t.txt But yeah, HDPMI32 is probably equally preferable due to various reasons (more recently updated, smaller? memory footprint, automagically enables SSE for you, etc.). EDIT: DOS386 wrote:
According to Tomasz, that (no unreal) was only true on early Cyrix since I think he claimed to have tested newer versions from friends. |
|||
25 Jan 2008, 05:27 |
|
rugxulo 02 Feb 2008, 16:42
Tomasz wrote:
Just FYI, I wrote a silly little .BAT that shaves approximately 37 bytes from FASM (but feel free to ignore). It seems to assemble (and reassemble) correctly, so I think it works. (I did try doing it via macro but failed miserably, heh. Oh well.) Code: @echo off :: Using GNU/DJGPP sed 4.1.5 to shave a few bytes from FASM 1.67.26 :: 1). show only these lines before and after :: sed -n "/add[ \t][ \t]*\(e\?[a-z][a-z]\)[ \t]*,[ \t]*2$/{p;s//rept 2 { inc \1 }/p}" .../*.* :: 2). show affected line numbers only :: sed -n "/add[ \t][ \t]*\(e\?[a-z][a-z]\)[ \t]*,[ \t]*2$/=" .../*.* :: 3). count total affected lines :: sed -n "/add[ \t][ \t]*\(e\?[a-z][a-z]\)[ \t]*,[ \t]*2$/=" .../*.* | sed -n $= :: 4). edit "in place" the files (i.e. make the optimizations!) sed -i "/add[ \t][ \t]*\(e\?[a-z][a-z]\)[ \t]*,[ \t]*2$/s//rept 2 { inc \1 }/" .../*.* http://gd.tuwien.ac.at/pc/dos/djgpp/beta/v2gnu/sed415b.zip (212k) http://gd.tuwien.ac.at/pc/dos/djgpp/current/v2gnu/sed415s.zip (1214k) |
|||
02 Feb 2008, 16:42 |
|
Goplat 03 Feb 2008, 01:30
Another possibility for making the code smaller: Make the instruction assembling routines be called instead of jmped, so the hundreds of 5-byte "jmp instruction_assembled"s all become little 1-byte "ret"s. This could save over a kilobyte.
|
|||
03 Feb 2008, 01:30 |
|
edfed 03 Feb 2008, 02:16
and that's why calls exists (at the origins), to make code clean, structured and little.
|
|||
03 Feb 2008, 02:16 |
|
Polygon 08 Feb 2008, 13:56
Hello! I'm trying to switch to unreal mode in a BIOS Option ROM. I need to address 4gig memory space, but haven't been able to get it to play properly. I read thru the Kelvar example and maybe I'm never switching to 32 bit is the issue. I'm a little new to assembly, so go easy on me
Can someone spot what is wrong with the "Flatmode" code or is this the FASM bug this very thread is about? Thanks in advance!: Code: use16 pushfd ; Push Flags Register onto the Stack (use 32) push eax push ebx push edx call flatmode ; first, set up FS to access all 4G mov eax,080000048h ; (G)MCH Base Address Register mov dx,0CF8h ; set port address out dx,eax ; send address through the port mov dx,0CFCh ; set port data in eax,dx ; fetch data mov ebx,eax ; save the old value or eax,1 ; increase data by new setting out dx,eax ; send data through port data and ebx,0FFFFC000h ; mask off bits 31:14 inclusive add ebx,250h ; point to the relevant part mov ax,[fs:ebx] ; fetch data at 250h address and ax,07FFh ; set Tras data bit to zero or ax,9000h ; copy data for Tras 18T mov [fs:ebx],ax ; send data with 18T change pop edx pop ebx pop eax popfd ; Pop Stack into Eflags Register retf ; Return Far from Procedure ;---------------------------------------------------------------------- flatmode: ; first, calculate the linear address of GDT xor edx,edx ; clear edx xor eax,eax ; clear edx mov dx,ds ; get the data segment shl edx,4 ; shift it over a bit cli ; turn off interrupts add [cs:dword GDT+2],edx ; store as GDT linear base addr ; now load the GDT into the GDTR lgdt fword ptr cs:GDT ; load GDT base (286-style 24-bit load) mov bx,8 ;1 * size DESC386 ; point to first descriptor mov eax,cr0 ; prepare to enter protected mode or al,1 ; flip the PE bit mov cr0,eax ; we're now in protected mode mov fs,bx ; load the FS segment register mov ds,bx ; mov es,bx ; mov gs,bx ; mov ss,bx ; load the SS segment register and al,0FEh ; clear the PE bit again mov cr0,eax ; back to real mode sti ; resume handling interrupts ret ; ;---------------------------------------------------------------------- GDT: dw 000fh ; limit low dw GDT ; base lo db 0 ; base mid db 0 ; dpltype db 0 ; lim hi db 0 ; base hi ; this is the setup for the 4G segment dw 0ffffh ; limit low dw 0 ; base lo db 0 ; base mid db 092h ; dpltype db 0cfh ; lim hi db 0 ; base hi GDT_END: |
|||
08 Feb 2008, 13:56 |
|
DJ Mauretto 08 Feb 2008, 14:04
Quote: I'm trying to switch to unreal mode in a BIOS Option ROM. I need to address 4gig memory space Enable A20 |
|||
08 Feb 2008, 14:04 |
|
Polygon 08 Feb 2008, 14:07
Thanks, but I don't know how to do that...
|
|||
08 Feb 2008, 14:07 |
|
edfed 08 Feb 2008, 14:16
enable A20 via keyboard controller.
there are many, many, many, many, and more example on this board, and on internet too. but the best is not to switch in unreal mode, but in protected mode. unreal is a sort of bad trick, that need to switch in pm, load segment registers with 4G limit selector, and return to real mode, without reloading real mode selectors. in the dex4u's package for the fasm browser project, there is a A20 switch function. |
|||
08 Feb 2008, 14:16 |
|
DJ Mauretto 08 Feb 2008, 14:21
Code: MACRO Wait_INPB { @@: IN AL,64H TEST AL,00000010B JNZ @B } MACRO Wait_OUTB { @@: IN AL,64H TEST AL,00000001B JZ @B } ;=============== ; Enable A20 ;=============== Wait_INPB MOV AL,0D0H OUT 64H,AL Wait_OUTB IN AL,60H OR AL,00000010B MOV BL,AL Wait_INPB MOV AL,0D1H OUT 64H,AL Wait_INPB MOV AL,BL OUT 60H,AL |
|||
08 Feb 2008, 14:21 |
|
Polygon 08 Feb 2008, 14:29
I guess I'm a little confused....
I'm executing code from within the BIOS which is mostly executing 16bit code. I need to address memory mapped registers, so I need 4gig addressing. Are you saying enabling the A20 gives me 4gig addressing? |
|||
08 Feb 2008, 14:29 |
|
revolution 08 Feb 2008, 14:32
edfed wrote: but the best is not to switch in unreal mode, but in protected mode. |
|||
08 Feb 2008, 14:32 |
|
edfed 08 Feb 2008, 14:53
the main problem with PM is the resident OS.
unlike RM, PM don't permitts to replace all the system. under RM OSes, we can replace all, from IVT to BIOS, but, if we boot on PM, the question is absent, no need of DOS, WIN$ or linuX to boot. and soon, no need of bios too. cause there are people that works on the direct PM switch. ad that is a good, really good step. VESA is a RM service, with optional PM services. but it's crap, i dislike the vesa mechanism. really. |
|||
08 Feb 2008, 14:53 |
|
vid 08 Feb 2008, 14:56
Quote: the main problem with PM is the resident OS. Actually that's the feature, not problem. Otherwise OS wouldn't have protection and would thus be unusuable for real desktop work. Quote: VESA is a RM service, with optional PM services. but it's crap, i dislike the vesa mechanism. really. feel free to write bunch of drivers for all those graphic cards |
|||
08 Feb 2008, 14:56 |
|
edfed 08 Feb 2008, 15:02
yep, and yep.
i'm reading the datasheet of my S3 savageIX card... ouch, it's really hardcore... it support besenham algorithm, hardware bitmap rotation, etc... pfiouuuuuu!!!! |
|||
08 Feb 2008, 15:02 |
|
revolution 08 Feb 2008, 15:26
edfed wrote: unlike RM, PM don't permitts to replace all the system. |
|||
08 Feb 2008, 15:26 |
|
edfed 08 Feb 2008, 15:50
if the system is like XP, you cannot run at IOPL 0
in fact, i don't know, i don't code for win$ |
|||
08 Feb 2008, 15:50 |
|
Goto page Previous 1, 2, 3, 4, 5 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.