mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 11:08:02 +02:00
haiku: removed old i386 specific syscalls assembler code and no-libc startup code, copied from the BeOS port initially, and was never in use on Haiku. kept the libc-version of assembly startup code for now for reference.
git-svn-id: trunk@40831 -
This commit is contained in:
parent
fa624e1ba5
commit
a6aa3cc092
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -9408,10 +9408,6 @@ rtl/haiku/errno.inc svneol=native#text/plain
|
||||
rtl/haiku/errnostr.inc svneol=native#text/plain
|
||||
rtl/haiku/i386/cprt0.as svneol=native#text/plain
|
||||
rtl/haiku/i386/dllcprt0.as svneol=native#text/plain
|
||||
rtl/haiku/i386/dllprt.as svneol=native#text/plain
|
||||
rtl/haiku/i386/dllprt.cpp svneol=native#text/plain
|
||||
rtl/haiku/i386/func.as svneol=native#text/plain
|
||||
rtl/haiku/i386/prt0.as svneol=native#text/plain
|
||||
rtl/haiku/i386/sig_cpu.inc svneol=native#text/plain
|
||||
rtl/haiku/i386/sighnd.inc svneol=native#text/plain
|
||||
rtl/haiku/osdefs.inc svneol=native#text/plain
|
||||
|
@ -338,7 +338,7 @@ INC=$(RTL)/inc
|
||||
PROCINC=$(RTL)/$(CPU_TARGET)
|
||||
UNIXINC=$(RTL)/unix
|
||||
HAIKUINC=$(RTL)/haiku
|
||||
LOADERS=prt0 cprt0 dllcprt0 func dllprt
|
||||
LOADERS=cprt0 dllcprt0
|
||||
CPUUNITS=mmx
|
||||
SYSINITUNITS=si_c si_dllc
|
||||
UNITPREFIX=rtl
|
||||
@ -3518,16 +3518,10 @@ include $(PROCINC)/makefile.cpu
|
||||
SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
|
||||
SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
|
||||
SYSTEMUNIT=system
|
||||
prt0$(OEXT) : $(CPU_TARGET)/prt0.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)prt0$(OEXT) $(CPU_TARGET)/prt0.as
|
||||
cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
|
||||
dllcprt0$(OEXT) : $(CPU_TARGET)/dllcprt0.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)dllcprt0$(OEXT) $(CPU_TARGET)/dllcprt0.as
|
||||
func$(OEXT) : $(CPU_TARGET)/func.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)func$(OEXT) $(CPU_TARGET)/func.as
|
||||
dllprt$(OEXT) : $(CPU_TARGET)/dllprt.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)dllprt$(OEXT) $(CPU_TARGET)/dllprt.as
|
||||
system$(PPUEXT) : system.pp $(SYSDEPS) $(UNIXINC)/sysunixh.inc
|
||||
$(COMPILER) $(FPC_SYSTEM_OPT) -Us -Sg $(SYSTEMUNIT).pp
|
||||
uuchar$(PPUEXT): $(SYSTEMUNIT)$(PPUEXT) $(INC)/uuchar.pp
|
||||
|
@ -61,7 +61,7 @@ INC=$(RTL)/inc
|
||||
PROCINC=$(RTL)/$(CPU_TARGET)
|
||||
UNIXINC=$(RTL)/unix
|
||||
HAIKUINC=$(RTL)/haiku
|
||||
LOADERS=prt0 cprt0 dllcprt0 func dllprt
|
||||
LOADERS=cprt0 dllcprt0
|
||||
CPUUNITS=mmx
|
||||
SYSINITUNITS=si_c si_dllc
|
||||
UNITPREFIX=rtl
|
||||
@ -105,8 +105,6 @@ SYSTEMUNIT=system
|
||||
# Loaders
|
||||
#
|
||||
|
||||
prt0$(OEXT) : $(CPU_TARGET)/prt0.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)prt0$(OEXT) $(CPU_TARGET)/prt0.as
|
||||
|
||||
cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)cprt0$(OEXT) $(CPU_TARGET)/cprt0.as
|
||||
@ -114,12 +112,6 @@ cprt0$(OEXT) : $(CPU_TARGET)/cprt0.as
|
||||
dllcprt0$(OEXT) : $(CPU_TARGET)/dllcprt0.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)dllcprt0$(OEXT) $(CPU_TARGET)/dllcprt0.as
|
||||
|
||||
func$(OEXT) : $(CPU_TARGET)/func.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)func$(OEXT) $(CPU_TARGET)/func.as
|
||||
|
||||
dllprt$(OEXT) : $(CPU_TARGET)/dllprt.as
|
||||
$(AS) -o $(UNITTARGETDIRPREFIX)dllprt$(OEXT) $(CPU_TARGET)/dllprt.as
|
||||
|
||||
#
|
||||
# system Units (system, Objpas, Strings)
|
||||
#
|
||||
|
@ -57,165 +57,6 @@ _haltproc:
|
||||
call exit
|
||||
|
||||
|
||||
/* int sys_open (int=0xFF000000, char * name, int mode, int=0, int close_on_exec=0); */
|
||||
.globl sys_open
|
||||
.type sys_open,@function
|
||||
sys_open:
|
||||
xorl %eax,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_close (int handle) */
|
||||
.globl sys_close
|
||||
.type sys_close,@function
|
||||
sys_close:
|
||||
mov $0x01,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_read (int handle, void * buffer, int length) */
|
||||
.globl sys_read
|
||||
.type sys_read,@function
|
||||
sys_read:
|
||||
movl $0x02,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_write (int handle, void * buffer, int length) */
|
||||
.globl sys_write
|
||||
.type sys_write,@function
|
||||
sys_write:
|
||||
movl $0x3,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_lseek (int handle, long long pos, int whence) */
|
||||
.globl sys_lseek
|
||||
.type sys_lseek,@function
|
||||
sys_lseek:
|
||||
movl $0x5,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_time(void) */
|
||||
.globl sys_time
|
||||
.type sys_time,@function
|
||||
sys_time:
|
||||
movl $0x7,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_resize_area */
|
||||
.globl sys_resize_area
|
||||
.type sys_resize_area,@function
|
||||
sys_resize_area:
|
||||
movl $0x8,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_opendir (0xFF000000, chra * name, 0) */
|
||||
.globl sys_opendir
|
||||
.type sys_opendir,@function
|
||||
sys_opendir:
|
||||
movl $0xC,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
|
||||
/* int sys_create_area */
|
||||
.globl sys_create_area
|
||||
.type sys_create_area,@function
|
||||
sys_create_area:
|
||||
movl $0x14,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_readdir (int handle, void * dirent, 0x11C, 0x01000000) */
|
||||
.globl sys_readdir
|
||||
.type sys_readdir,@function
|
||||
sys_readdir:
|
||||
movl $0x1C,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_mkdir (char=0xFF, char * name, int mode) */
|
||||
.globl sys_mkdir
|
||||
.type sys_mkdir,@function
|
||||
sys_mkdir:
|
||||
movl $0x1E,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_wait_for_thread */
|
||||
.globl sys_wait_for_thread
|
||||
.type sys_wait_for_thread,@function
|
||||
sys_wait_for_thread:
|
||||
movl $0x22,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_rename (int=0xFF000000, char * name, int=0xFF000000, char * newname) */
|
||||
.globl sys_rename
|
||||
.type sys_rename,@function
|
||||
sys_rename:
|
||||
movl $0x26,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_unlink (int=0xFF000000, char * name) */
|
||||
.globl sys_unlink
|
||||
.type sys_unlink,@function
|
||||
sys_unlink:
|
||||
movl $0x27,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_stat (int=0xFF000000, char * name, struct stat * s, int=0) */
|
||||
.globl sys_stat
|
||||
.type sys_stat,@function
|
||||
sys_stat:
|
||||
movl $0x30,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_load_image */
|
||||
.globl sys_load_image
|
||||
.type sys_load_image,@function
|
||||
sys_load_image:
|
||||
movl $0x34,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_exit (int exitcode) */
|
||||
.globl sys_exit
|
||||
.type sys_exit,@function
|
||||
sys_exit:
|
||||
movl $0x3F,%eax
|
||||
int $0x25
|
||||
|
||||
/* void sys_chdir (char 0xFF, char * name) */
|
||||
.globl sys_chdir
|
||||
.type sys_chdir,@function
|
||||
sys_chdir:
|
||||
movl $0x57,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_rmdir (char 0xFF, char * name) */
|
||||
.globl sys_rmdir
|
||||
.type sys_rmdir,@function
|
||||
sys_rmdir:
|
||||
movl $0x60,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* actual syscall */
|
||||
.globl sys_call
|
||||
.type sys_call,@function
|
||||
sys_call:
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
.bss
|
||||
.comm operatingsystem_parameter_envp,4
|
||||
.comm operatingsystem_parameter_argc,4
|
||||
|
@ -7,8 +7,8 @@ default_environ:
|
||||
.globl initialize_after
|
||||
.type initialize_after,@function
|
||||
initialize_after:
|
||||
.globl FPC_SHARED_LIB_START
|
||||
.type FPC_SHARED_LIB_START,@function
|
||||
.globl FPC_SHARED_LIB_START
|
||||
.type FPC_SHARED_LIB_START,@function
|
||||
FPC_SHARED_LIB_START:
|
||||
/* We are in a library if we link something against this code */
|
||||
movb $1,operatingsystem_islibrary
|
||||
@ -40,168 +40,8 @@ _haltproc:
|
||||
pushl %ebx
|
||||
call exit
|
||||
|
||||
|
||||
/* int sys_open (int=0xFF000000, char * name, int mode, int=0, int close_on_exec=0); */
|
||||
.globl sys_open
|
||||
.type sys_open,@function
|
||||
sys_open:
|
||||
xorl %eax,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_close (int handle) */
|
||||
.globl sys_close
|
||||
.type sys_close,@function
|
||||
sys_close:
|
||||
mov $0x01,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_read (int handle, void * buffer, int length) */
|
||||
.globl sys_read
|
||||
.type sys_read,@function
|
||||
sys_read:
|
||||
movl $0x02,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_write (int handle, void * buffer, int length) */
|
||||
.globl sys_write
|
||||
.type sys_write,@function
|
||||
sys_write:
|
||||
movl $0x3,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_lseek (int handle, long long pos, int whence) */
|
||||
.globl sys_lseek
|
||||
.type sys_lseek,@function
|
||||
sys_lseek:
|
||||
movl $0x5,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_time(void) */
|
||||
.globl sys_time
|
||||
.type sys_time,@function
|
||||
sys_time:
|
||||
movl $0x7,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_resize_area */
|
||||
.globl sys_resize_area
|
||||
.type sys_resize_area,@function
|
||||
sys_resize_area:
|
||||
movl $0x8,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_opendir (0xFF000000, chra * name, 0) */
|
||||
.globl sys_opendir
|
||||
.type sys_opendir,@function
|
||||
sys_opendir:
|
||||
movl $0xC,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
|
||||
/* int sys_create_area */
|
||||
.globl sys_create_area
|
||||
.type sys_create_area,@function
|
||||
sys_create_area:
|
||||
movl $0x14,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_readdir (int handle, void * dirent, 0x11C, 0x01000000) */
|
||||
.globl sys_readdir
|
||||
.type sys_readdir,@function
|
||||
sys_readdir:
|
||||
movl $0x1C,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_mkdir (char=0xFF, char * name, int mode) */
|
||||
.globl sys_mkdir
|
||||
.type sys_mkdir,@function
|
||||
sys_mkdir:
|
||||
movl $0x1E,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_wait_for_thread */
|
||||
.globl sys_wait_for_thread
|
||||
.type sys_wait_for_thread,@function
|
||||
sys_wait_for_thread:
|
||||
movl $0x22,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_rename (int=0xFF000000, char * name, int=0xFF000000, char * newname) */
|
||||
.globl sys_rename
|
||||
.type sys_rename,@function
|
||||
sys_rename:
|
||||
movl $0x26,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_unlink (int=0xFF000000, char * name) */
|
||||
.globl sys_unlink
|
||||
.type sys_unlink,@function
|
||||
sys_unlink:
|
||||
movl $0x27,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_stat (int=0xFF000000, char * name, struct stat * s, int=0) */
|
||||
.globl sys_stat
|
||||
.type sys_stat,@function
|
||||
sys_stat:
|
||||
movl $0x30,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_load_image */
|
||||
.globl sys_load_image
|
||||
.type sys_load_image,@function
|
||||
sys_load_image:
|
||||
movl $0x34,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_exit (int exitcode) */
|
||||
.globl sys_exit
|
||||
.type sys_exit,@function
|
||||
sys_exit:
|
||||
movl $0x3F,%eax
|
||||
int $0x25
|
||||
|
||||
/* void sys_chdir (char 0xFF, char * name) */
|
||||
.globl sys_chdir
|
||||
.type sys_chdir,@function
|
||||
sys_chdir:
|
||||
movl $0x57,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_rmdir (char 0xFF, char * name) */
|
||||
.globl sys_rmdir
|
||||
.type sys_rmdir,@function
|
||||
sys_rmdir:
|
||||
movl $0x60,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* actual syscall */
|
||||
.globl sys_call
|
||||
.type sys_call,@function
|
||||
sys_call:
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
.bss
|
||||
.comm operatingsystem_parameter_envp,4
|
||||
.comm operatingsystem_parameter_argc,4
|
||||
.comm operatingsystem_parameter_argv,4
|
||||
|
||||
|
||||
|
@ -1,170 +0,0 @@
|
||||
.file "dllprt.cpp"
|
||||
.text
|
||||
.p2align 2
|
||||
.globl _._7FPC_DLL
|
||||
.type _._7FPC_DLL,@function
|
||||
_._7FPC_DLL:
|
||||
.LFB1:
|
||||
pushl %ebp
|
||||
.LCFI0:
|
||||
movl %esp,%ebp
|
||||
.LCFI1:
|
||||
pushl %esi
|
||||
.LCFI2:
|
||||
pushl %ebx
|
||||
.LCFI3:
|
||||
call .L7
|
||||
.L7:
|
||||
popl %ebx
|
||||
addl $_GLOBAL_OFFSET_TABLE_+[.-.L7],%ebx
|
||||
movl 8(%ebp),%esi
|
||||
.L3:
|
||||
movl 12(%ebp),%eax
|
||||
andl $1,%eax
|
||||
testl %eax,%eax
|
||||
je .L5
|
||||
pushl %esi
|
||||
.LCFI4:
|
||||
call __builtin_delete@PLT
|
||||
addl $4,%esp
|
||||
jmp .L5
|
||||
.p2align 4,,7
|
||||
.L4:
|
||||
.L5:
|
||||
.L2:
|
||||
leal -8(%ebp),%esp
|
||||
popl %ebx
|
||||
popl %esi
|
||||
movl %ebp,%esp
|
||||
popl %ebp
|
||||
ret
|
||||
.LFE1:
|
||||
.Lfe1:
|
||||
.size _._7FPC_DLL,.Lfe1-_._7FPC_DLL
|
||||
.section .rodata
|
||||
.LC0:
|
||||
.string "dll"
|
||||
.data
|
||||
.align 4
|
||||
.type _argv,@object
|
||||
.size _argv,8
|
||||
_argv:
|
||||
.long .LC0
|
||||
.long 0
|
||||
.align 4
|
||||
.type _envp,@object
|
||||
.size _envp,4
|
||||
_envp:
|
||||
.long 0
|
||||
.text
|
||||
.p2align 2
|
||||
.globl __7FPC_DLL
|
||||
.type __7FPC_DLL,@function
|
||||
__7FPC_DLL:
|
||||
.LFB2:
|
||||
pushl %ebp
|
||||
.LCFI5:
|
||||
movl %esp,%ebp
|
||||
.LCFI6:
|
||||
pushl %ebx
|
||||
.LCFI7:
|
||||
call .L11
|
||||
.L11:
|
||||
popl %ebx
|
||||
addl $_GLOBAL_OFFSET_TABLE_+[.-.L11],%ebx
|
||||
movl operatingsystem_parameter_argc@GOT(%ebx),%eax
|
||||
movl $0,(%eax)
|
||||
movl operatingsystem_parameter_argv@GOT(%ebx),%eax
|
||||
movl %ebx,%ecx
|
||||
addl $_argv@GOTOFF,%ecx
|
||||
movl %ecx,%edx
|
||||
movl %edx,(%eax)
|
||||
movl operatingsystem_parameter_envp@GOT(%ebx),%eax
|
||||
movl %ebx,%ecx
|
||||
addl $_envp@GOTOFF,%ecx
|
||||
movl %ecx,%edx
|
||||
movl %edx,(%eax)
|
||||
call PASCALMAIN__Fv@PLT
|
||||
.L9:
|
||||
movl 8(%ebp),%eax
|
||||
jmp .L8
|
||||
.L8:
|
||||
movl -4(%ebp),%ebx
|
||||
movl %ebp,%esp
|
||||
popl %ebp
|
||||
ret
|
||||
.LFE2:
|
||||
.Lfe2:
|
||||
.size __7FPC_DLL,.Lfe2-__7FPC_DLL
|
||||
|
||||
.section .eh_frame,"aw",@progbits
|
||||
__FRAME_BEGIN__:
|
||||
.4byte .LLCIE1
|
||||
.LSCIE1:
|
||||
.4byte 0x0
|
||||
.byte 0x1
|
||||
.byte 0x0
|
||||
.byte 0x1
|
||||
.byte 0x7c
|
||||
.byte 0x8
|
||||
.byte 0xc
|
||||
.byte 0x4
|
||||
.byte 0x4
|
||||
.byte 0x88
|
||||
.byte 0x1
|
||||
.align 4
|
||||
.LECIE1:
|
||||
.set .LLCIE1,.LECIE1-.LSCIE1
|
||||
.4byte .LLFDE1
|
||||
.LSFDE1:
|
||||
.4byte .LSFDE1-__FRAME_BEGIN__
|
||||
.4byte .LFB1
|
||||
.4byte .LFE1-.LFB1
|
||||
.byte 0x4
|
||||
.4byte .LCFI0-.LFB1
|
||||
.byte 0xe
|
||||
.byte 0x8
|
||||
.byte 0x85
|
||||
.byte 0x2
|
||||
.byte 0x4
|
||||
.4byte .LCFI1-.LCFI0
|
||||
.byte 0xd
|
||||
.byte 0x5
|
||||
.byte 0x4
|
||||
.4byte .LCFI2-.LCFI1
|
||||
.byte 0x86
|
||||
.byte 0x3
|
||||
.byte 0x4
|
||||
.4byte .LCFI3-.LCFI2
|
||||
.byte 0x83
|
||||
.byte 0x4
|
||||
.byte 0x4
|
||||
.4byte .LCFI4-.LCFI3
|
||||
.byte 0x2e
|
||||
.byte 0x4
|
||||
.align 4
|
||||
.LEFDE1:
|
||||
.set .LLFDE1,.LEFDE1-.LSFDE1
|
||||
.4byte .LLFDE3
|
||||
.LSFDE3:
|
||||
.4byte .LSFDE3-__FRAME_BEGIN__
|
||||
.4byte .LFB2
|
||||
.4byte .LFE2-.LFB2
|
||||
.byte 0x4
|
||||
.4byte .LCFI5-.LFB2
|
||||
.byte 0xe
|
||||
.byte 0x8
|
||||
.byte 0x85
|
||||
.byte 0x2
|
||||
.byte 0x4
|
||||
.4byte .LCFI6-.LCFI5
|
||||
.byte 0xd
|
||||
.byte 0x5
|
||||
.byte 0x4
|
||||
.4byte .LCFI7-.LCFI6
|
||||
.byte 0x83
|
||||
.byte 0x3
|
||||
.align 4
|
||||
.LEFDE3:
|
||||
.set .LLFDE3,.LEFDE3-.LSFDE3
|
||||
.ident "GCC: (GNU) 2.9-beos-991026"
|
@ -1,39 +0,0 @@
|
||||
#include <stdio.h>
|
||||
|
||||
class FPC_DLL
|
||||
{
|
||||
public:
|
||||
FPC_DLL();
|
||||
// ~FPC_DLL();
|
||||
};
|
||||
|
||||
static FPC_DLL fpc_dll();
|
||||
|
||||
//FPC_DLL::~FPC_DLL()
|
||||
//{
|
||||
// printf ("main thread ended.");
|
||||
//}
|
||||
|
||||
|
||||
extern "C" void PASCALMAIN(void);
|
||||
extern int operatingsystem_parameter_argc;
|
||||
extern void * operatingsystem_parameter_argv;
|
||||
extern void * operatingsystem_parameter_envp;
|
||||
|
||||
static char * _argv[] = {"dll",0};
|
||||
static char * _envp[] = {0};
|
||||
|
||||
extern "C" void BEGIN()
|
||||
{
|
||||
printf ("init\n");
|
||||
operatingsystem_parameter_argc=0;
|
||||
operatingsystem_parameter_argv = (void *)_argv;
|
||||
operatingsystem_parameter_envp = (void *)_envp;
|
||||
PASCALMAIN();
|
||||
}
|
||||
|
||||
FPC_DLL::FPC_DLL()
|
||||
{
|
||||
BEGIN();
|
||||
}
|
||||
|
@ -1,161 +0,0 @@
|
||||
.file "func.s"
|
||||
.text
|
||||
|
||||
.globl _haltproc
|
||||
.type _haltproc,@function
|
||||
_haltproc:
|
||||
xorl %ebx,%ebx
|
||||
movw operatingsystem_result,%bx
|
||||
pushl %ebx
|
||||
call sys_exit
|
||||
|
||||
/* int sys_open (int=0xFF000000, char * name, int mode, int=0, int close_on_exec=0); */
|
||||
.globl sys_open
|
||||
.type sys_open,@function
|
||||
sys_open:
|
||||
xorl %eax,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_close (int handle) */
|
||||
.globl sys_close
|
||||
.type sys_close,@function
|
||||
sys_close:
|
||||
mov $0x01,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_read (int handle, void * buffer, int length) */
|
||||
.globl sys_read
|
||||
.type sys_read,@function
|
||||
sys_read:
|
||||
movl $0x02,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_write (int handle, void * buffer, int length) */
|
||||
.globl sys_write
|
||||
.type sys_write,@function
|
||||
sys_write:
|
||||
movl $0x3,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_lseek (int handle, long long pos, int whence) */
|
||||
.globl sys_lseek
|
||||
.type sys_lseek,@function
|
||||
sys_lseek:
|
||||
movl $0x5,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_time(void) */
|
||||
.globl sys_time
|
||||
.type sys_time,@function
|
||||
sys_time:
|
||||
movl $0x7,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_resize_area */
|
||||
.globl sys_resize_area
|
||||
.type sys_resize_area,@function
|
||||
sys_resize_area:
|
||||
movl $0x8,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_opendir (0xFF000000, chra * name, 0) */
|
||||
.globl sys_opendir
|
||||
.type sys_opendir,@function
|
||||
sys_opendir:
|
||||
movl $0xC,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_create_area */
|
||||
.globl sys_create_area
|
||||
.type sys_create_area,@function
|
||||
sys_create_area:
|
||||
movl $0x14,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_readdir (int handle, void * dirent, 0x11C, 0x01000000) */
|
||||
.globl sys_readdir
|
||||
.type sys_readdir,@function
|
||||
sys_readdir:
|
||||
movl $0x1C,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_mkdir (char=0xFF, char * name, int mode) */
|
||||
.globl sys_mkdir
|
||||
.type sys_mkdir,@function
|
||||
sys_mkdir:
|
||||
movl $0x1E,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_wait_for_thread */
|
||||
.globl sys_wait_for_thread
|
||||
.type sys_wait_for_thread,@function
|
||||
sys_wait_for_thread:
|
||||
movl $0x22,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_rename (int=0xFF000000, char * name, int=0xFF000000, char * newname) */
|
||||
.globl sys_rename
|
||||
.type sys_rename,@function
|
||||
sys_rename:
|
||||
movl $0x26,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_unlink (int=0xFF000000, char * name) */
|
||||
.globl sys_unlink
|
||||
.type sys_unlink,@function
|
||||
sys_unlink:
|
||||
movl $0x27,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_stat (int=0xFF000000, char * name, struct stat * s, int=0) */
|
||||
.globl sys_stat
|
||||
.type sys_stat,@function
|
||||
sys_stat:
|
||||
movl $0x30,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_load_image */
|
||||
.globl sys_load_image
|
||||
.type sys_load_image,@function
|
||||
sys_load_image:
|
||||
movl $0x34,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_exit (int exitcode) */
|
||||
.globl sys_exit
|
||||
.type sys_exit,@function
|
||||
sys_exit:
|
||||
movl $0x3F,%eax
|
||||
int $0x25
|
||||
|
||||
/* void sys_chdir (char 0xFF, char * name) */
|
||||
.globl sys_chdir
|
||||
.type sys_chdir,@function
|
||||
sys_chdir:
|
||||
movl $0x57,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_rmdir (char 0xFF, char * name) */
|
||||
.globl sys_rmdir
|
||||
.type sys_rmdir,@function
|
||||
sys_rmdir:
|
||||
movl $0x60,%eax
|
||||
int $0x25
|
||||
ret
|
@ -1,186 +0,0 @@
|
||||
.file "prt0.c"
|
||||
.text
|
||||
.globl start
|
||||
.type start,@function
|
||||
start:
|
||||
pushl %ebp
|
||||
movl %esp,%ebp
|
||||
movl 16(%ebp),%ecx
|
||||
movl 12(%ebp),%ebx
|
||||
movl 8(%ebp),%eax
|
||||
movl %eax,operatingsystem_parameter_argc
|
||||
movl %ebx,operatingsystem_parameter_argv
|
||||
movl %ecx,operatingsystem_parameter_envp
|
||||
xorl %ebp,%ebp
|
||||
call PASCALMAIN
|
||||
|
||||
.globl _haltproc
|
||||
.type _haltproc,@function
|
||||
_haltproc:
|
||||
xorl %ebx,%ebx
|
||||
movw operatingsystem_result,%bx
|
||||
pushl %ebx
|
||||
call sys_exit
|
||||
|
||||
/* int sys_open (int=0xFF000000, char * name, int mode, int=0, int close_on_exec=0); */
|
||||
.globl sys_open
|
||||
.type sys_open,@function
|
||||
sys_open:
|
||||
xorl %eax,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_close (int handle) */
|
||||
.globl sys_close
|
||||
.type sys_close,@function
|
||||
sys_close:
|
||||
mov $0x01,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_read (int handle, void * buffer, int length) */
|
||||
.globl sys_read
|
||||
.type sys_read,@function
|
||||
sys_read:
|
||||
movl $0x02,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_write (int handle, void * buffer, int length) */
|
||||
.globl sys_write
|
||||
.type sys_write,@function
|
||||
sys_write:
|
||||
movl $0x3,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_lseek (int handle, long long pos, int whence) */
|
||||
.globl sys_lseek
|
||||
.type sys_lseek,@function
|
||||
sys_lseek:
|
||||
movl $0x5,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_time(void) */
|
||||
.globl sys_time
|
||||
.type sys_time,@function
|
||||
sys_time:
|
||||
movl $0x7,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_resize_area */
|
||||
.globl sys_resize_area
|
||||
.type sys_resize_area,@function
|
||||
sys_resize_area:
|
||||
movl $0x8,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_opendir (0xFF000000, chra * name, 0) */
|
||||
.globl sys_opendir
|
||||
.type sys_opendir,@function
|
||||
sys_opendir:
|
||||
movl $0xC,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_create_area */
|
||||
.globl sys_create_area
|
||||
.type sys_create_area,@function
|
||||
sys_create_area:
|
||||
movl $0x14,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_readdir (int handle, void * dirent, 0x11C, 0x01000000) */
|
||||
.globl sys_readdir
|
||||
.type sys_readdir,@function
|
||||
sys_readdir:
|
||||
movl $0x1C,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_mkdir (char=0xFF, char * name, int mode) */
|
||||
.globl sys_mkdir
|
||||
.type sys_mkdir,@function
|
||||
sys_mkdir:
|
||||
movl $0x1E,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_wait_for_thread */
|
||||
.globl sys_wait_for_thread
|
||||
.type sys_wait_for_thread,@function
|
||||
sys_wait_for_thread:
|
||||
movl $0x22,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_rename (int=0xFF000000, char * name, int=0xFF000000, char * newname) */
|
||||
.globl sys_rename
|
||||
.type sys_rename,@function
|
||||
sys_rename:
|
||||
movl $0x26,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_unlink (int=0xFF000000, char * name) */
|
||||
.globl sys_unlink
|
||||
.type sys_unlink,@function
|
||||
sys_unlink:
|
||||
movl $0x27,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_stat (int=0xFF000000, char * name, struct stat * s, int=0) */
|
||||
.globl sys_stat
|
||||
.type sys_stat,@function
|
||||
sys_stat:
|
||||
movl $0x30,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* int sys_load_image */
|
||||
.globl sys_load_image
|
||||
.type sys_load_image,@function
|
||||
sys_load_image:
|
||||
movl $0x34,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_exit (int exitcode) */
|
||||
.globl sys_exit
|
||||
.type sys_exit,@function
|
||||
sys_exit:
|
||||
movl $0x3F,%eax
|
||||
int $0x25
|
||||
|
||||
/* void sys_chdir (char 0xFF, char * name) */
|
||||
.globl sys_chdir
|
||||
.type sys_chdir,@function
|
||||
sys_chdir:
|
||||
movl $0x57,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* void sys_rmdir (char 0xFF, char * name) */
|
||||
.globl sys_rmdir
|
||||
.type sys_rmdir,@function
|
||||
sys_rmdir:
|
||||
movl $0x60,%eax
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
/* actual syscall */
|
||||
.globl sys_call
|
||||
.type sys_call,@function
|
||||
sys_call:
|
||||
int $0x25
|
||||
ret
|
||||
|
||||
.bss
|
||||
.comm operatingsystem_parameter_envp,4
|
||||
.comm operatingsystem_parameter_argc,4
|
||||
.comm operatingsystem_parameter_argv,4
|
Loading…
Reference in New Issue
Block a user