🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.asm.x86
5 messages
5 total messages Started by Marcus Johansson Sun, 26 Jul 1998 00:00
Loading files in DPMI
#132
Author: Marcus Johansson
Date: Sun, 26 Jul 1998 00:00
9 lines
1557 bytes
I am almoust finsihed with my DPMI loader but I can only load 64kbit
files, anyone know how to load programs when operating in protectedmode?

The dos routine for loading files seemes to be limited to 64kb so how do

I load larger files, anyone got any code for it? Or suggestions?

Thanks,
Marcus
Re: Loading files in DPMI
#128
Author: David Lindauer
Date: Sun, 26 Jul 1998 00:00
30 lines
2556 bytes
In my app I still link the DPMI driver in with the pmode code, and then load
it into extended memory with rep movsd.  But that limits you to the DOS 640K
for program sizes.  If you have a borland or watcom linker you can write
a loader for their EXE files; those files are NOT in the dos format but in
the windows and OS/2 formats.  There is documentation on the net about
these formats,  but I'm not sure where you would find it.

David

Marcus Johansson wrote:

> I am almoust finsihed with my DPMI loader but I can only load 64kbit
> files, anyone know how to load programs when operating in protectedmode?
>
> The dos routine for loading files seemes to be limited to 64kb so how do
>
> I load larger files, anyone got any code for it? Or suggestions?
>
> Thanks,
> Marcus



--
---------------------------------------------------------------
David Lindauer    mailto:camille@bluegrass.net     ICQ: 8699592

http://www.geocities.com/Area51/Station/5196/index.html    (home page)
http://www.geocities.com/Area51/Station/5196/ttc.html      (tao te ching)
http://www.geocities.com/Area51/Station/5196/treasure.html (computer page)
Re: Loading files in DPMI
#129
Author: Marcus Johansson
Date: Sun, 26 Jul 1998 00:00
10 lines
1667 bytes

David Lindauer wrote:

> In my app I still link the DPMI driver in with the pmode code, and then load
> it into extended memory with rep movsd.  But that limits you to the DOS 640K
> for program sizes.  If you have a borland or watcom linker you can write

How do you do to link it to the same file, do you use Turbo Linker?
/Marcus
Re: Loading files in DPMI
#130
Author: David Lindauer
Date: Mon, 27 Jul 1998 00:00
27 lines
2457 bytes
turbo linker has some bugs; while you CAN use it to generate 32-bit
pmode files if you incorporate a DPMI interface I don't recommend it.
I use a version of the VAL linker which I rewrote to handle both 16 and 32-bit
records...

David

Marcus Johansson wrote:

> David Lindauer wrote:
>
> > In my app I still link the DPMI driver in with the pmode code, and then load
> > it into extended memory with rep movsd.  But that limits you to the DOS 640K
> > for program sizes.  If you have a borland or watcom linker you can write
>
> How do you do to link it to the same file, do you use Turbo Linker?
> /Marcus



--
---------------------------------------------------------------
David Lindauer    mailto:camille@bluegrass.net     ICQ: 8699592

http://www.geocities.com/Area51/Station/5196/index.html    (home page)
http://www.geocities.com/Area51/Station/5196/ttc.html      (tao te ching)
http://www.geocities.com/Area51/Station/5196/treasure.html (computer page)
Re: Loading files in DPMI
#131
Author: Andrey Chirikba
Date: Tue, 28 Jul 1998 00:00
56 lines
2838 bytes
On 26 Jul 1998 02:37:55 GMT, Marcus Johansson <marcus.johansson@mbox005.swipnet.se> wrote:

Just load it by parts of 64Kb. I don't know how about PM, but in the real mode I use something like this:

	mov	ecx,[filesize]
	mov	ax,[segment]
	mov	ds,ax
Again:
	push	ecx			; Store on stack, how much left to read
	test	ecx,0FFFF0000h	; Less than 64Kb -- than read it
	jz	NotTooMuch
	mov	cx,0FFFFh		; Else read 65535
NotTooMuch:
	<here we read 65535 bytes>	; DOS call  (don't forget BX=FileHandle)
	pop	eax			; Restore the value
	jc	Error			; Any errors?
	sub	eax,cx			; How much left to read?
	jz	Done			; Nothing -- out
	push	ecx
	mov	dx,0FFFFh		; Read one byte to the
	mov	cx,1			; very end of the segment
	<read one more byte>		; DOS call
	pop	ecx
	jc	Error
	dec	ecx			; Nothing left -- then exit
	jz	Done
	mov	ax,ds			; Increase DS by 1000h -- to the next phys. segment
	add	ax,1000h
	mov	ds,ax
	jmp	Again			; "On and on... "
Done:
	. . .
Error:


I don't guarantee you'll be able to use this in PM (I never written progs for PM in asm), but, it's not bad (I don't say
"not buggy")

>I am almoust finsihed with my DPMI loader but I can only load 64kbit
>files, anyone know how to load programs when operating in protectedmode?
>
>The dos routine for loading files seemes to be limited to 64kb so how do
>
>I load larger files, anyone got any code for it? Or suggestions?
>
>Thanks,
>Marcus
>
>

{****************************************}
{ If you want to run Setup,             *}
{ Press DELETE at the startup           *}
{****************************************}

Delete <chirikba@rullet.leidenuniv.nl>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads