Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

32-bit MSDOS (Announce)

posted by kerravon E-mail, Ligao, Free World North, 04.07.2021, 02:50

warning - failed to open AUTOEXEC.BAT

A:\]dir
IO.SYS 17882 2021-06-07 19:03:42
COMMAND.COM 71152 2021-06-28 21:45:06
KERNEL32.DLL 35328 2021-06-07 20:08:20 kernel32.dll
MSVCRT.DLL 38400 2021-06-07 20:10:30 msvcrt.dll
TERMINAL.EXE 15883 2021-06-14 15:00:04
HDTOFIL.EXE 4096 2021-06-13 15:13:58
ZFILL.EXE 3584 2021-06-25 22:31:56
HEXDUMP.EXE 3584 2021-06-13 15:11:38
PDPTEST.EXE 4608 2021-06-13 15:10:46
PORTINIT.EXE 15041 2021-06-13 15:01:54
PORTREAD.EXE 15741 2021-06-13 15:03:18
PORTWRIT.EXE 15567 2021-06-13 15:03:50
ZAP.EXE 3072 2021-06-13 15:13:18
README.TXT 2014 2021-06-13 15:50:38 readme.txt
MSDOS.SYS 106016 2021-06-28 21:57:12 msdos.sys
WORLDPAS.EXE 8928 2021-07-04 10:40:42 worldpas.exe

A:\]worldpas
warning - failed to open worldpas.com
Hello, World

A:\]


Can't ask for more than that.

Now to consolidate. A clean link would be good,
but I don't know if I'm hitting limitations of
ldwin.

BFN. Paul.



C:\devel\pascal>objdump -p worldpas.exe | grep -i dll
DllCharacteristics 00000000
vma: Hint Time Forward DLL First
DLL Name: msvcrt.dll



C:\devel\pascal>type pascals.s
# Public Domain by Paul Edwards

.section .text
.balign 16,0x90

.globl fpc_initializeunits
fpc_initializeunits:
call _fpc_initializeunits
ret

.globl fpc_get_output
fpc_get_output:
call _fpc_get_output
ret


# eax has a 0, don't know what that is
# edx has file handle
# ecx has string to print, first character has length

.globl fpc_write_text_shortstr
fpc_write_text_shortstr:
push %edx
push %ecx
push %eax
call _fpc_write_text_shortstr

# This "add" doesn't seem to work for some reason
# add %esp, 12
pop %eax
pop %ecx
pop %edx
ret

.globl fpc_iocheck
fpc_iocheck:
call _fpc_iocheck
ret

.globl fpc_writeln_end
fpc_writeln_end:
call _fpc_writeln_end
ret

.globl fpc_do_exit
fpc_do_exit:
call _fpc_do_exit
ret

.section .data

.globl FPC_RESOURCESTRINGTABLES
FPC_RESOURCESTRINGTABLES:

.globl FPC_RESSTRINITTABLES
FPC_RESSTRINITTABLES:

.globl FPC_THREADVARTABLES
FPC_THREADVARTABLES:

.globl FPC_WIDEINITTABLES
FPC_WIDEINITTABLES:

.globl INITFINAL
INITFINAL:

.globl PASCALMAIN
PASCALMAIN:

.globl INIT$_$SYSTEM
INIT$_$SYSTEM:

.globl INIT$_$FPINTRES
INIT$_$FPINTRES:

.globl THREADVARLIST_$SYSTEM$indirect
THREADVARLIST_$SYSTEM$indirect:

C:\devel\pascal>




C:\devel\pascal>type pascalc.c
/* public domain by Paul Edwards */

#include <stdio.h>
#include <stdlib.h>

void fpc_initializeunits(void)
{
return;
}

int fpc_get_output(void)
{
return ((int)stdout);
}

void fpc_write_text_shortstr(int handle, char *str, int unknown)
{
/* fputs(str, (FILE*)handle); */
/* fputs("fix the registers", stdout); */
fwrite(str + 1, str[0], 1, stdout);
return;
}

void fpc_iocheck(void)
{
return;
}

void fpc_writeln_end(void)
{
printf("\n");
}

void fpc_do_exit(int x)
{
exit(x);
}

C:\devel\pascal>



C:\devel\pascal>type makefile.w32
# Produce Windows executables
# links with PDPCLIB created by makefile.msv

CC=gccwin
CFLAGS=-O2
LD=ldwin
LDFLAGS=--noinhibit-exec
AS=aswin
AR=arwin
COPTS=-S $(CFLAGS) -fno-common -ansi -I. -I../pdos/pdpclib -D__WIN32__

all: clean worldpas.exe

worldpas.exe: worldpas.o pascalc.o pascals.o
$(LD) $(LDFLAGS) -s -o worldpas.exe ../pdos/pdpclib/w32start.o worldpas.o pascalc.o pascals.o ../pdos/pdpclib/msvcrt.a


# Without "-s", this produces an executable (but can be ignored)
# With "-s" this produces crap (which can be deleted)
# I choose to delete crap
.pas.o:
fpc -a -s $<
rm -fr link*.res
rm -fr ppas.bat
$(AS) -o $@ $*.s
rm -f $*.s

.c.o:
$(CC) $(COPTS) -o $*.s $<
$(AS) -o $@ $*.s
rm -f $*.s

.s.o:
$(AS) -o $@ $*.s

clean:
rm -f *.o worldpas.exe

C:\devel\pascal>



C:\devel\pascal>type worldpas.pas
program world;

begin
writeln('Hello, World')
end.

C:\devel\pascal>

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 515 users online (0 registered, 515 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum