* worked all day. probably a lot changed

This commit is contained in:
marco 2000-04-10 15:46:51 +00:00
parent 37339f70a6
commit 28ef8ce303
7 changed files with 5703 additions and 5686 deletions

View File

@ -1,108 +1,108 @@
$Id$
1 FreeBSD status and notes. (kept on CVS because I work on several places)
-----------------------------------------------------------------------------
At the moment that you are reading this, FPC for FreeBSD is still a dream.
We are currently working actively on FreeBSD support.
NI=not implemented yet
req=required for compiler
noreq? = probably not required, but not checked.
syscall status comment
------------------------------------------------------------------------
Readdir req implemented from scratch, not working. (since this
call doesn't exist on FBSD and FindFirst is based on it.
Clone() NI noreq Looks awfully complicated. Should be based on RFork.
sysinfo NI noreq Not supported under BSD, not even by emulator
uname NI noreq " " " " " " " "
(procedure based on this call are also commented
(get* procs))
signal NI noreq? A *lot* of emulation code.
alarm NI noreq? Could be possible to port.
pause NI noreq? Also possible I think. Uses process information
in linux-emu, that is why I didn't port directly.
IOPERM NI noreq? Concept doesn't exist on FreeBSD. No IO outside kernel?
2 How to build a FreeBSD compiler.
-----------------------------------------------------------------------------
Comments, mistakes and suggestions to Marcov@stack.nl
The FreeBSD port is 99% experimental atm, though valid native binaries can be
obtained. They mosttimes don't function yet.
Supported are probably FreeBSD 3.x (3.2, 3.4 and 4.0-release tested).
The procedure here is verbose, and for the most akward case.
If you have linux support on on your FreeBSD machine, or operate on NFS or samba
share (so that copying and using the sources in two systems is easier)
some steps can be omitted or simplified. Just play with it.
STEP A: create the RTL assembler files.
1a. Copy all linux files to a new directory. (here called BSDBUILD), and
1b. edit the makefile to NOT compile the i386 directory. (we do that by
hand for now) I do this by emptying the LOADEROBJECTS= line.
2. Copy all bsd files over them.
3. execute make OPT='-Tlinux -dBSD -a -s -OG3p3' (with any i386 FPC compiler)
in directory BSDBUILD. This failed with some go32v2 versions (which wanted
to assemble anyway), but worked with several win32 and linux' snapshots.
You know have .ppu's and .s 's for the RTL hopefully.
STEP B: Create the compiler assembler sources;
This will generate the .s files for the compiler.
4. Copy the mppc386.bat file in the compiler/ directory, and delete anything but
the ppc386 line.
5. Add "-Fu\BSDPATH\BSDBUILD -s -a -dBSD" to the line, and delete all %1 %2 options
which then look like this:
ppc386 -O3p3 -Ch8000000 -dI386 -dGDB -dBROWSERLOG -Sg pp.pas -Fu\BSDPATH\BSDBUILD -s -a -dBSD -Tlinux
6. Execute this line in the compiler directory (direct or via script)
STEP C: Building the binary
7. Copy all necessary files
(- all *.s *.ppu files, both from compiler and BSDBUILD dir,
- compiler/link.res and
- compiler/ppas.sh
- Cut and paste of the DO_S script at the end of this document to file
- rtl/bsd/i386/*.s files
)
to a directory on the BSD machine.
8. Change to the directory on the BSD machine, and run the script DO_S to assemble
.s files to .o files.
9. Adapt link.res so that all paths to the BSD machine are right.
10. run ppas.sh
You know should have a native FreeBSD "pp" binary.
------------------
The DO_S script.
------------------
#!/bin/sh
for i in *.s; do
flup=`basename $i .s`
as $i -o $flup.o
echo $i
echo $flup
done
{
$Id$
1 FreeBSD status and notes. (kept on CVS because I work on several places)
-----------------------------------------------------------------------------
At the moment that you are reading this, FPC for FreeBSD is still a dream.
We are currently working actively on FreeBSD support.
NI=not implemented yet
req=required for compiler
noreq? = probably not required, but not checked.
syscall status comment
------------------------------------------------------------------------
Readdir req implemented from scratch, not working. (since this
call doesn't exist on FBSD and FindFirst is based on it.
Clone() NI noreq Looks awfully complicated. Should be based on RFork.
sysinfo NI noreq Not supported under BSD, not even by emulator
uname NI noreq " " " " " " " "
(procedure based on this call are also commented
(get* procs))
signal NI noreq? A *lot* of emulation code.
alarm NI noreq? Could be possible to port.
pause NI noreq? Also possible I think. Uses process information
in linux-emu, that is why I didn't port directly.
IOPERM NI noreq? Concept doesn't exist on FreeBSD. No IO outside kernel?
2 How to build a FreeBSD compiler.
-----------------------------------------------------------------------------
Comments, mistakes and suggestions to Marcov@stack.nl
The FreeBSD port is 99% experimental atm, though valid native binaries can be
obtained. They mosttimes don't function yet.
Supported are probably FreeBSD 3.x (3.2, 3.4 and 4.0-release tested).
The procedure here is verbose, and for the most akward case.
If you have linux support on on your FreeBSD machine, or operate on NFS or samba
share (so that copying and using the sources in two systems is easier)
some steps can be omitted or simplified. Just play with it.
STEP A: create the RTL assembler files.
1a. Copy all linux files to a new directory. (here called BSDBUILD), and
1b. edit the makefile to NOT compile the i386 directory. (we do that by
hand for now) I do this by emptying the LOADEROBJECTS= line.
2. Copy all bsd files over them.
3. execute make OPT='-Tlinux -dBSD -a -s -OG3p3' (with any i386 FPC compiler)
in directory BSDBUILD. This failed with some go32v2 versions (which wanted
to assemble anyway), but worked with several win32 and linux' snapshots.
You know have .ppu's and .s 's for the RTL hopefully.
STEP B: Create the compiler assembler sources;
This will generate the .s files for the compiler.
4. Copy the mppc386.bat file in the compiler/ directory, and delete anything but
the ppc386 line.
5. Add "-Fu\BSDPATH\BSDBUILD -s -a -dBSD" to the line, and delete all %1 %2 options
which then look like this:
ppc386 -O3p3 -Ch8000000 -dI386 -dGDB -dBROWSERLOG -Sg pp.pas -Fu\BSDPATH\BSDBUILD -s -a -dBSD -Tlinux
6. Execute this line in the compiler directory (direct or via script)
STEP C: Building the binary
7. Copy all necessary files
(- all *.s *.ppu files, both from compiler and BSDBUILD dir,
- compiler/link.res and
- compiler/ppas.sh
- Cut and paste of the DO_S script at the end of this document to file
- rtl/bsd/i386/*.s files
)
to a directory on the BSD machine.
8. Change to the directory on the BSD machine, and run the script DO_S to assemble
.s files to .o files.
9. Adapt link.res so that all paths to the BSD machine are right.
10. run ppas.sh
You know should have a native FreeBSD "pp" binary.
------------------
The DO_S script.
------------------
#!/bin/sh
for i in *.s; do
flup=`basename $i .s`
as $i -o $flup.o
echo $i
echo $flup
done
{
$Log$
Revision 1.1 2000-04-07 20:51:16 marco
* updates.
}
Revision 1.2 2000-04-10 15:46:51 marco
* worked all day. probably a lot changed
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,113 +1,113 @@
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by Michael Van Canneyt,
member of the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{BSD version, only the blocks with BSD in the comment are updated}
Const
{ Things for LSEEK call, same in linux and BSD }
Seek_set = 0;
Seek_Cur = 1;
Seek_End = 2;
{ Things for OPEN call - after include/sys/fcntl.h, BSD updated.
BSD specifies these constants in hex }
Open_Accmode = 3;
Open_RdOnly = 0;
Open_WrOnly = 1;
Open_RdWr = 2;
Open_NonBlock = 4;
Open_Append = 8;
Open_ShLock = $10;
Open_ExLock = $20;
Open_ASync = $40;
Open_FSync = $80;
Open_NoFollow = $100;
Open_Create = $200; {BSD convention}
Open_Creat = $200; {Linux convention}
Open_Trunc = $400;
Open_Excl = $800;
{ The waitpid uses the following options:}
Wait_NoHang = 1;
Wait_UnTraced = 2;
Wait_Any = -1;
Wait_MyPGRP = 0;
{ Constants to check stat.mode - checked all STAT constants with BSD}
STAT_IFMT = $f000; {00170000 }
STAT_IFSOCK = $c000; {0140000 }
STAT_IFLNK = $a000; {0120000 }
STAT_IFREG = $8000; {0100000 }
STAT_IFBLK = $6000; {0060000 }
STAT_IFDIR = $4000; {0040000 }
STAT_IFCHR = $2000; {0020000 }
STAT_IFIFO = $1000; {0010000 }
STAT_ISUID = $0800; {0004000 }
STAT_ISGID = $0400; {0002000 }
STAT_ISVTX = $0200; {0001000}
{ Constants to check permissions all }
STAT_IRWXO = $7;
STAT_IROTH = $4;
STAT_IWOTH = $2;
STAT_IXOTH = $1;
STAT_IRWXG = STAT_IRWXO shl 3;
STAT_IRGRP = STAT_IROTH shl 3;
STAT_IWGRP = STAT_IWOTH shl 3;
STAT_IXGRP = STAT_IXOTH shl 3;
STAT_IRWXU = STAT_IRWXO shl 6;
STAT_IRUSR = STAT_IROTH shl 6;
STAT_IWUSR = STAT_IWOTH shl 6;
STAT_IXUSR = STAT_IXOTH shl 6;
{ Constants to test the type of filesystem }
fs_old_ext2 = $ef51;
fs_ext2 = $ef53;
fs_ext = $137d;
fs_iso = $9660;
fs_minix = $137f;
fs_minix_30 = $138f;
fs_minux_V2 = $2468;
fs_msdos = $4d44;
fs_nfs = $6969;
fs_proc = $9fa0;
fs_xia = $012FD16D;
{
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by Michael Van Canneyt,
member of the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{BSD version, only the blocks with BSD in the comment are updated}
Const
{ Things for LSEEK call, same in linux and BSD }
Seek_set = 0;
Seek_Cur = 1;
Seek_End = 2;
{ Things for OPEN call - after include/sys/fcntl.h, BSD updated.
BSD specifies these constants in hex }
Open_Accmode = 3;
Open_RdOnly = 0;
Open_WrOnly = 1;
Open_RdWr = 2;
Open_NonBlock = 4;
Open_Append = 8;
Open_ShLock = $10;
Open_ExLock = $20;
Open_ASync = $40;
Open_FSync = $80;
Open_NoFollow = $100;
Open_Create = $200; {BSD convention}
Open_Creat = $200; {Linux convention}
Open_Trunc = $400;
Open_Excl = $800;
{ The waitpid uses the following options:}
Wait_NoHang = 1;
Wait_UnTraced = 2;
Wait_Any = -1;
Wait_MyPGRP = 0;
{ Constants to check stat.mode - checked all STAT constants with BSD}
STAT_IFMT = $f000; {00170000 }
STAT_IFSOCK = $c000; {0140000 }
STAT_IFLNK = $a000; {0120000 }
STAT_IFREG = $8000; {0100000 }
STAT_IFBLK = $6000; {0060000 }
STAT_IFDIR = $4000; {0040000 }
STAT_IFCHR = $2000; {0020000 }
STAT_IFIFO = $1000; {0010000 }
STAT_ISUID = $0800; {0004000 }
STAT_ISGID = $0400; {0002000 }
STAT_ISVTX = $0200; {0001000}
{ Constants to check permissions all }
STAT_IRWXO = $7;
STAT_IROTH = $4;
STAT_IWOTH = $2;
STAT_IXOTH = $1;
STAT_IRWXG = STAT_IRWXO shl 3;
STAT_IRGRP = STAT_IROTH shl 3;
STAT_IWGRP = STAT_IWOTH shl 3;
STAT_IXGRP = STAT_IXOTH shl 3;
STAT_IRWXU = STAT_IRWXO shl 6;
STAT_IRUSR = STAT_IROTH shl 6;
STAT_IWUSR = STAT_IWOTH shl 6;
STAT_IXUSR = STAT_IXOTH shl 6;
{ Constants to test the type of filesystem }
fs_old_ext2 = $ef51;
fs_ext2 = $ef53;
fs_ext = $137d;
fs_iso = $9660;
fs_minix = $137f;
fs_minix_30 = $138f;
fs_minux_V2 = $2468;
fs_msdos = $4d44;
fs_nfs = $6969;
fs_proc = $9fa0;
fs_xia = $012FD16D;
{
$Log$
Revision 1.4 2000-04-07 20:51:17 marco
* updates.
Revision 1.3 2000/02/03 17:05:13 marco
* fixes and updates due to linux unit porting
Revision 1.2 2000/02/02 16:35:29 marco
* Checked stat constants
Revision 1.1 2000/02/02 15:41:28 marco
* initial BSD version.
Revision 1.4 2000/01/07 16:41:41 daniel
* copyright 2000
Revision 1.3 2000/01/07 16:32:28 daniel
* copyright 2000 added
Revision 1.2 1998/05/06 12:38:22 michael
+ Removed log from before restored version.
Revision 1.1.1.1 1998/03/25 11:18:43 root
* Restored version
}
Revision 1.5 2000-04-10 15:46:52 marco
* worked all day. probably a lot changed
Revision 1.3 2000/02/03 17:05:13 marco
* fixes and updates due to linux unit porting
Revision 1.2 2000/02/02 16:35:29 marco
* Checked stat constants
Revision 1.1 2000/02/02 15:41:28 marco
* initial BSD version.
Revision 1.4 2000/01/07 16:41:41 daniel
* copyright 2000
Revision 1.3 2000/01/07 16:32:28 daniel
* copyright 2000 added
Revision 1.2 1998/05/06 12:38:22 michael
+ Removed log from before restored version.
Revision 1.1.1.1 1998/03/25 11:18:43 root
* Restored version
}

File diff suppressed because it is too large Load Diff

View File

@ -1,388 +1,388 @@
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by Michael Van Canneyt,
member of the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
const
{ Unverified calls.
syscall_nr_setup = 0;
syscall_nr_creat = 8;
syscall_nr_time = 13;
syscall_nr_break = 17;
syscall_nr_oldstat = 18;
syscall_nr_mount = 21;
syscall_nr_umount = 22;
syscall_nr_setuid = 23;
syscall_nr_stime = 25;
syscall_nr_ptrace = 26;
syscall_nr_alarm = 27;
syscall_nr_oldfstat = 28;
syscall_nr_pause = 29;
syscall_nr_stty = 31;
syscall_nr_gtty = 32;
syscall_nr_nice = 34;
syscall_nr_ftime = 35;
syscall_nr_sync = 36;
syscall_nr_times = 43;
syscall_nr_prof = 44;
syscall_nr_brk = 45;
syscall_nr_setgid = 46;
syscall_nr_signal = 48;
syscall_nr_acct = 51;
syscall_nr_phys = 52;
syscall_nr_lock = 53;
syscall_nr_mpx = 56;
syscall_nr_setpgid = 57;
syscall_nr_ulimit = 58;
syscall_nr_oldolduname = 59;
syscall_nr_chroot = 61;
syscall_nr_ustat = 62;
syscall_nr_getpgrp = 65;
syscall_nr_setsid = 66;
syscall_nr_sgetmask = 68;
syscall_nr_ssetmask = 69;
syscall_nr_setreuid = 70;
syscall_nr_setregid = 71;
syscall_nr_sethostname = 74;
syscall_nr_setrlimit = 75;
syscall_nr_getrlimit = 76;
syscall_nr_getrusage = 77;
syscall_nr_settimeofday = 79;
syscall_nr_getgroups = 80;
syscall_nr_setgroups = 81;
syscall_nr_oldlstat = 84;
syscall_nr_uselib = 86;
syscall_nr_swapon = 87;
syscall_nr_reboot = 88;
syscall_nr_readdir = 89;
syscall_nr_munmap = 91;
syscall_nr_truncate = 92;
syscall_nr_fchmod = 94;
syscall_nr_fchown = 95;
syscall_nr_profil = 98;
syscall_nr_ioperm = 101;
syscall_nr_socketcall = 102;
syscall_nr_syslog = 103;
syscall_nr_setitimer = 104;
syscall_nr_getitimer = 105;
syscall_nr_olduname = 109;
syscall_nr_iopl = 110;
syscall_nr_vhangup = 111;
syscall_nr_idle = 112;
syscall_nr_vm86old = 113;
syscall_nr_wait4 = 114;
syscall_nr_swapoff = 115;
syscall_nr_sysinfo = 116;
syscall_nr_ipc = 117;
syscall_nr_sigreturn = 119;
syscall_nr_clone = 120;
syscall_nr_setdomainname = 121;
syscall_nr_uname = 122;
syscall_nr_modify_ldt = 123;
syscall_nr_adjtimex = 124;
syscall_nr_mprotect = 125;
syscall_nr_create_module = 127;
syscall_nr_init_module = 128;
syscall_nr_delete_module = 129;
syscall_nr_get_kernel_syms = 130;
syscall_nr_quotactl = 131;
syscall_nr_getpgid = 132;
syscall_nr_fchdir = 133;
syscall_nr_bdflush = 134;
syscall_nr_sysfs = 135;
syscall_nr_personality = 136;
syscall_nr_afs_syscall = 137;
syscall_nr_setfsuid = 138;
syscall_nr_setfsgid = 139;
syscall_nr__llseek = 140;
syscall_nr__newselect = 142;
syscall_nr_msync = 144;
syscall_nr_readv = 145;
syscall_nr_writev = 146;
syscall_nr_getsid = 147;
syscall_nr_fdatasync = 148;
syscall_nr__sysctl = 149;
syscall_nr_mlock = 150;
syscall_nr_munlock = 151;
syscall_nr_mlockall = 152;
syscall_nr_munlockall = 153;
syscall_nr_sched_setparam = 154;
syscall_nr_sched_getparam = 155;
syscall_nr_sched_setscheduler = 156;
syscall_nr_sched_getscheduler = 157;
syscall_nr_sched_yield = 158;
syscall_nr_sched_get_priority_max = 159;
syscall_nr_sched_get_priority_min = 160;
syscall_nr_sched_rr_get_interval = 161;
syscall_nr_nanosleep = 162;
syscall_nr_mremap = 163;
syscall_nr_setresuid = 164;
syscall_nr_getresuid = 165;
syscall_nr_vm86 = 166;
syscall_nr_query_module = 167;
syscall_nr_poll = 168;
}
{More or less checked BSD syscalls}
syscall_nr_exit = 1;
syscall_nr_fork = 2;
syscall_nr_read = 3;
syscall_nr_write = 4;
syscall_nr_open = 5;
syscall_nr_close = 6;
syscall_nr_waitpid = 7;
syscall_nr_link = 9;
syscall_nr_unlink = 10;
syscall_nr_chdir = 12;
syscall_nr_mknod = 14;
syscall_nr_chmod = 15;
syscall_nr_chown = 16;
syscall_nr_getpid = 20;
syscall_nr_getuid = 24;
syscall_nr_geteuid = 25;
syscall_nr_access = 33;
syscall_nr_kill = 37;
syscall_nr_rename = 128;
syscall_nr_getppid = 39;
syscall_nr_dup = 41;
syscall_nr_pipe = 42;
syscall_nr_getegid = 43;
syscall_nr_getgid = 47;
syscall_nr_sigprocmask = 340;
syscall_nr_sigpending = 343;
syscall_nr_ioctl = 54;
syscall_nr_symlink = 57;
syscall_nr_readlink = 58;
syscall_nr_execve = 59;
syscall_nr_umask = 60;
syscall_nr_dup2 = 90;
syscall_nr_fcntl = 92;
syscall_nr_select = 93;
syscall_nr_fsync = 95;
syscall_nr_setpriority = 96;
syscall_nr_getpriority = 100;
syscall_nr_sigsuspend = 341;
syscall_nr_sigaction = 342;
syscall_nr_gettimeofday = 116;
syscall_nr_flock = 131;
syscall_nr_mkdir = 136;
syscall_nr_rmdir = 137;
syscall_nr_utimes = 138;
syscall_nr_statfs = 157;
syscall_nr_fstatfs = 158;
syscall_nr_stat = 188;
syscall_nr_fstat = 189;
syscall_nr_lstat = 190;
syscall_nr_mmap = 197;
syscall_nr_lseek = 199;
syscall_nr_ftruncate = 201;
syscall_nr_getdents = 272;
{$IFNDEF BSD}
{$IFDEF SYSCALL_DEBUG}
const
Sys_nr_txt : array[0..168] of string[15]=(
'Setup', { 0 }
'Exit', { 1 }
'Fork', { 2 }
'Read', { 3 }
'Write', { 4 }
'Open', { 5 }
'Close', { 6 }
'WaitPid', { 7 }
'Create', { 8 }
'Link', { 9 }
'UnLink', { 10 }
'ExecVe', { 11 }
'ChDir', { 12 }
'Time', { 13 }
'MkNod', { 14 }
'ChMod', { 15 }
'ChOwn', { 16 }
'Break', { 17 }
'OldState', { 18 }
'LSeek', { 19 }
'GetPid', { 20 }
'Mount', { 21 }
'UMount', { 22 }
'SetUid', { 23 }
'GetUid', { 24 }
'STime', { 25 }
'PTrace', { 26 }
'Alarm', { 27 }
'OldFStat', { 28 }
'Pause', { 29 }
'UTime', { 30 }
'STTY', { 31 }
'GTTY', { 32 }
'Access', { 33 }
'Nice', { 34 }
'FTime', { 35 }
'Sync', { 36 }
'Kill', { 37 }
'Rename', { 38 }
'MkDir', { 39 }
'RmDir', { 40 }
'Dup', { 41 }
'Pipe', { 42 }
'Times', { 43 }
'Prof', { 44 }
'Break', { 45 }
'SetGid', { 46 }
'GetGid', { 47 }
'Signal', { 48 }
'GetEUid', { 49 }
'GetEGid', { 50 }
'Acct', { 51 }
'Phys', { 52 }
'Lock', { 53 }
'IOCtl', { 54 }
'FCNtl', { 55 }
'Mpx', { 56 }
'SetPGid', { 57 }
'ULimit', { 58 }
'OldOldUName', { 59 }
'UMask', { 60 }
'ChRoot', { 61 }
'UStat', { 62 }
'Dup2', { 63 }
'GetPPid', { 64 }
'GetPGrp', { 65 }
'SetSid', { 66 }
'SigAction', { 67 }
'SGetMask', { 68 }
'SSetMask', { 69 }
'SetReUid', { 70 }
'SetReGid', { 71 }
'SigSuspend', { 72 }
'SigPending', { 73 }
'SetHostName', { 74 }
'SetRLimit', { 75 }
'GetRLimit', { 76 }
'GetRUsage', { 77 }
'GetTimeOfDay', { 78 }
'SetTimeOfDay', { 79 }
'GetGroups', { 80 }
'SetGroups', { 81 }
'Select', { 82 }
'SymLink', { 83 }
'OldLStat', { 84 }
'ReadLink', { 85 }
'UseLib', { 86 }
'SwapOn', { 87 }
'Reboot', { 88 }
'ReadDir', { 89 }
'MMap', { 90 }
'MunMap', { 91 }
'Truncate', { 92 }
'FTruncate', { 93 }
'FChMod', { 94 }
'FChOwn', { 95 }
'GetPriority', { 96 }
'SetPriority', { 97 }
'Profile', { 98 }
'StatFs', { 99 }
'FStatFs', { 100 }
'IOPerm', { 101 }
'SocketCall', { 102 }
'SysLog', { 103 }
'SetITimer', { 104 }
'GetITimer', { 105 }
'Stat', { 106 }
'LStat', { 107 }
'FStat', { 108 }
'OldUName', { 109 }
'IOPl', { 110 }
'VHangup', { 111 }
'Idle', { 112 }
'VM86', { 113 }
'Wait4', { 114 }
'SwapOff', { 115 }
'SysInfo', { 116 }
'IPC', { 117 }
'FSync', { 118 }
'SigReturn', { 119 }
'Clone', { 120 }
'SetDomainName', { 121 }
'UName', { 122 }
'Modify_Ldt', { 123 }
'AdjTimeX', { 124 }
'MProtect', { 125 }
'SigProcMask', { 126 }
'Create_Module', { 127 }
'Init_Module', { 128 }
'Delete_Module', { 129 }
'Get_Kernel_Syms', { 130 }
'QuotaCtl', { 131 }
'GetPGid', { 132 }
'FChDir', { 133 }
'BDFlush', { 134 }
'SysFs', { 135 }
'Personality', { 136 }
'AFS_SysCall', { 137 }
'SetFsUid', { 138 }
'SetFsGid', { 139 }
'__LLSeek', { 140 }
'GetDents', { 141 }
'__NewSelect', { 142 }
'FLock', { 143 }
'MSync', { 144 }
'ReadV', { 145 }
'WriteV', { 146 }
'GetSid', { 147 }
'FDataSync', { 148 }
'__SysCtl', { 149 }
'MLock', { 150 }
'MUnLock', { 151 }
'MLockAll', { 152 }
'MUnLockAll', { 153 }
'MSchdSetParam', { 154 }
'MSchdGetParam', { 155 }
'MSchdSetSchd', { 156 }
'MSchdGetSchd', { 157 }
'MSchdYield', { 158 }
'MSchdGetPriMax', { 159 }
'MSchdGetPriMin', { 160 }
'MSchdRRGetInt', { 161 }
'NanoSleep', { 162 }
'MRemap', { 163 }
'SetReSuid', { 164 }
'GetReSuid', { 165 }
'vm86', { 166 }
'QueryModule', { 167 }
'Poll'); { 168 }
{$ENDIF}
{$ENDIF}
{
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by Michael Van Canneyt,
member of the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
const
{ Unverified calls.
syscall_nr_setup = 0;
syscall_nr_creat = 8;
syscall_nr_time = 13;
syscall_nr_break = 17;
syscall_nr_oldstat = 18;
syscall_nr_mount = 21;
syscall_nr_umount = 22;
syscall_nr_setuid = 23;
syscall_nr_stime = 25;
syscall_nr_ptrace = 26;
syscall_nr_alarm = 27;
syscall_nr_oldfstat = 28;
syscall_nr_pause = 29;
syscall_nr_stty = 31;
syscall_nr_gtty = 32;
syscall_nr_nice = 34;
syscall_nr_ftime = 35;
syscall_nr_sync = 36;
syscall_nr_times = 43;
syscall_nr_prof = 44;
syscall_nr_brk = 45;
syscall_nr_setgid = 46;
syscall_nr_signal = 48;
syscall_nr_acct = 51;
syscall_nr_phys = 52;
syscall_nr_lock = 53;
syscall_nr_mpx = 56;
syscall_nr_setpgid = 57;
syscall_nr_ulimit = 58;
syscall_nr_oldolduname = 59;
syscall_nr_chroot = 61;
syscall_nr_ustat = 62;
syscall_nr_getpgrp = 65;
syscall_nr_setsid = 66;
syscall_nr_sgetmask = 68;
syscall_nr_ssetmask = 69;
syscall_nr_setreuid = 70;
syscall_nr_setregid = 71;
syscall_nr_sethostname = 74;
syscall_nr_setrlimit = 75;
syscall_nr_getrlimit = 76;
syscall_nr_getrusage = 77;
syscall_nr_settimeofday = 79;
syscall_nr_getgroups = 80;
syscall_nr_setgroups = 81;
syscall_nr_oldlstat = 84;
syscall_nr_uselib = 86;
syscall_nr_swapon = 87;
syscall_nr_reboot = 88;
syscall_nr_readdir = 89;
syscall_nr_munmap = 91;
syscall_nr_truncate = 92;
syscall_nr_fchmod = 94;
syscall_nr_fchown = 95;
syscall_nr_profil = 98;
syscall_nr_ioperm = 101;
syscall_nr_socketcall = 102;
syscall_nr_syslog = 103;
syscall_nr_setitimer = 104;
syscall_nr_getitimer = 105;
syscall_nr_olduname = 109;
syscall_nr_iopl = 110;
syscall_nr_vhangup = 111;
syscall_nr_idle = 112;
syscall_nr_vm86old = 113;
syscall_nr_wait4 = 114;
syscall_nr_swapoff = 115;
syscall_nr_sysinfo = 116;
syscall_nr_ipc = 117;
syscall_nr_sigreturn = 119;
syscall_nr_clone = 120;
syscall_nr_setdomainname = 121;
syscall_nr_uname = 122;
syscall_nr_modify_ldt = 123;
syscall_nr_adjtimex = 124;
syscall_nr_mprotect = 125;
syscall_nr_create_module = 127;
syscall_nr_init_module = 128;
syscall_nr_delete_module = 129;
syscall_nr_get_kernel_syms = 130;
syscall_nr_quotactl = 131;
syscall_nr_getpgid = 132;
syscall_nr_fchdir = 133;
syscall_nr_bdflush = 134;
syscall_nr_sysfs = 135;
syscall_nr_personality = 136;
syscall_nr_afs_syscall = 137;
syscall_nr_setfsuid = 138;
syscall_nr_setfsgid = 139;
syscall_nr__llseek = 140;
syscall_nr__newselect = 142;
syscall_nr_msync = 144;
syscall_nr_readv = 145;
syscall_nr_writev = 146;
syscall_nr_getsid = 147;
syscall_nr_fdatasync = 148;
syscall_nr__sysctl = 149;
syscall_nr_mlock = 150;
syscall_nr_munlock = 151;
syscall_nr_mlockall = 152;
syscall_nr_munlockall = 153;
syscall_nr_sched_setparam = 154;
syscall_nr_sched_getparam = 155;
syscall_nr_sched_setscheduler = 156;
syscall_nr_sched_getscheduler = 157;
syscall_nr_sched_yield = 158;
syscall_nr_sched_get_priority_max = 159;
syscall_nr_sched_get_priority_min = 160;
syscall_nr_sched_rr_get_interval = 161;
syscall_nr_nanosleep = 162;
syscall_nr_mremap = 163;
syscall_nr_setresuid = 164;
syscall_nr_getresuid = 165;
syscall_nr_vm86 = 166;
syscall_nr_query_module = 167;
syscall_nr_poll = 168;
}
{More or less checked BSD syscalls}
syscall_nr_exit = 1;
syscall_nr_fork = 2;
syscall_nr_read = 3;
syscall_nr_write = 4;
syscall_nr_open = 5;
syscall_nr_close = 6;
syscall_nr_waitpid = 7;
syscall_nr_link = 9;
syscall_nr_unlink = 10;
syscall_nr_chdir = 12;
syscall_nr_mknod = 14;
syscall_nr_chmod = 15;
syscall_nr_chown = 16;
syscall_nr_getpid = 20;
syscall_nr_getuid = 24;
syscall_nr_geteuid = 25;
syscall_nr_access = 33;
syscall_nr_kill = 37;
syscall_nr_rename = 128;
syscall_nr_getppid = 39;
syscall_nr_dup = 41;
syscall_nr_pipe = 42;
syscall_nr_getegid = 43;
syscall_nr_getgid = 47;
syscall_nr_sigprocmask = 340;
syscall_nr_sigpending = 343;
syscall_nr_ioctl = 54;
syscall_nr_symlink = 57;
syscall_nr_readlink = 58;
syscall_nr_execve = 59;
syscall_nr_umask = 60;
syscall_nr_dup2 = 90;
syscall_nr_fcntl = 92;
syscall_nr_select = 93;
syscall_nr_fsync = 95;
syscall_nr_setpriority = 96;
syscall_nr_getpriority = 100;
syscall_nr_sigsuspend = 341;
syscall_nr_sigaction = 342;
syscall_nr_gettimeofday = 116;
syscall_nr_flock = 131;
syscall_nr_mkdir = 136;
syscall_nr_rmdir = 137;
syscall_nr_utimes = 138;
syscall_nr_statfs = 157;
syscall_nr_fstatfs = 158;
syscall_nr_stat = 188;
syscall_nr_fstat = 189;
syscall_nr_lstat = 190;
syscall_nr_mmap = 197;
syscall_nr_lseek = 199;
syscall_nr_ftruncate = 201;
syscall_nr_getdents = 272;
{$IFNDEF BSD}
{$IFDEF SYSCALL_DEBUG}
const
Sys_nr_txt : array[0..168] of string[15]=(
'Setup', { 0 }
'Exit', { 1 }
'Fork', { 2 }
'Read', { 3 }
'Write', { 4 }
'Open', { 5 }
'Close', { 6 }
'WaitPid', { 7 }
'Create', { 8 }
'Link', { 9 }
'UnLink', { 10 }
'ExecVe', { 11 }
'ChDir', { 12 }
'Time', { 13 }
'MkNod', { 14 }
'ChMod', { 15 }
'ChOwn', { 16 }
'Break', { 17 }
'OldState', { 18 }
'LSeek', { 19 }
'GetPid', { 20 }
'Mount', { 21 }
'UMount', { 22 }
'SetUid', { 23 }
'GetUid', { 24 }
'STime', { 25 }
'PTrace', { 26 }
'Alarm', { 27 }
'OldFStat', { 28 }
'Pause', { 29 }
'UTime', { 30 }
'STTY', { 31 }
'GTTY', { 32 }
'Access', { 33 }
'Nice', { 34 }
'FTime', { 35 }
'Sync', { 36 }
'Kill', { 37 }
'Rename', { 38 }
'MkDir', { 39 }
'RmDir', { 40 }
'Dup', { 41 }
'Pipe', { 42 }
'Times', { 43 }
'Prof', { 44 }
'Break', { 45 }
'SetGid', { 46 }
'GetGid', { 47 }
'Signal', { 48 }
'GetEUid', { 49 }
'GetEGid', { 50 }
'Acct', { 51 }
'Phys', { 52 }
'Lock', { 53 }
'IOCtl', { 54 }
'FCNtl', { 55 }
'Mpx', { 56 }
'SetPGid', { 57 }
'ULimit', { 58 }
'OldOldUName', { 59 }
'UMask', { 60 }
'ChRoot', { 61 }
'UStat', { 62 }
'Dup2', { 63 }
'GetPPid', { 64 }
'GetPGrp', { 65 }
'SetSid', { 66 }
'SigAction', { 67 }
'SGetMask', { 68 }
'SSetMask', { 69 }
'SetReUid', { 70 }
'SetReGid', { 71 }
'SigSuspend', { 72 }
'SigPending', { 73 }
'SetHostName', { 74 }
'SetRLimit', { 75 }
'GetRLimit', { 76 }
'GetRUsage', { 77 }
'GetTimeOfDay', { 78 }
'SetTimeOfDay', { 79 }
'GetGroups', { 80 }
'SetGroups', { 81 }
'Select', { 82 }
'SymLink', { 83 }
'OldLStat', { 84 }
'ReadLink', { 85 }
'UseLib', { 86 }
'SwapOn', { 87 }
'Reboot', { 88 }
'ReadDir', { 89 }
'MMap', { 90 }
'MunMap', { 91 }
'Truncate', { 92 }
'FTruncate', { 93 }
'FChMod', { 94 }
'FChOwn', { 95 }
'GetPriority', { 96 }
'SetPriority', { 97 }
'Profile', { 98 }
'StatFs', { 99 }
'FStatFs', { 100 }
'IOPerm', { 101 }
'SocketCall', { 102 }
'SysLog', { 103 }
'SetITimer', { 104 }
'GetITimer', { 105 }
'Stat', { 106 }
'LStat', { 107 }
'FStat', { 108 }
'OldUName', { 109 }
'IOPl', { 110 }
'VHangup', { 111 }
'Idle', { 112 }
'VM86', { 113 }
'Wait4', { 114 }
'SwapOff', { 115 }
'SysInfo', { 116 }
'IPC', { 117 }
'FSync', { 118 }
'SigReturn', { 119 }
'Clone', { 120 }
'SetDomainName', { 121 }
'UName', { 122 }
'Modify_Ldt', { 123 }
'AdjTimeX', { 124 }
'MProtect', { 125 }
'SigProcMask', { 126 }
'Create_Module', { 127 }
'Init_Module', { 128 }
'Delete_Module', { 129 }
'Get_Kernel_Syms', { 130 }
'QuotaCtl', { 131 }
'GetPGid', { 132 }
'FChDir', { 133 }
'BDFlush', { 134 }
'SysFs', { 135 }
'Personality', { 136 }
'AFS_SysCall', { 137 }
'SetFsUid', { 138 }
'SetFsGid', { 139 }
'__LLSeek', { 140 }
'GetDents', { 141 }
'__NewSelect', { 142 }
'FLock', { 143 }
'MSync', { 144 }
'ReadV', { 145 }
'WriteV', { 146 }
'GetSid', { 147 }
'FDataSync', { 148 }
'__SysCtl', { 149 }
'MLock', { 150 }
'MUnLock', { 151 }
'MLockAll', { 152 }
'MUnLockAll', { 153 }
'MSchdSetParam', { 154 }
'MSchdGetParam', { 155 }
'MSchdSetSchd', { 156 }
'MSchdGetSchd', { 157 }
'MSchdYield', { 158 }
'MSchdGetPriMax', { 159 }
'MSchdGetPriMin', { 160 }
'MSchdRRGetInt', { 161 }
'NanoSleep', { 162 }
'MRemap', { 163 }
'SetReSuid', { 164 }
'GetReSuid', { 165 }
'vm86', { 166 }
'QueryModule', { 167 }
'Poll'); { 168 }
{$ENDIF}
{$ENDIF}
{
$Log$
Revision 1.3 2000-04-07 20:51:17 marco
* updates.
Revision 1.2 2000/04/05 13:59:10 marco
* added constants for syscall.inc
Revision 1.1 2000/04/05 13:06:24 marco
* Initial version. (copied from linux.) Patch for BSD not ready yeT
Revision 1.5 2000/02/09 16:59:32 peter
* truncated log
Revision 1.4 2000/01/07 16:41:41 daniel
* copyright 2000
Revision 1.3 2000/01/07 16:32:28 daniel
* copyright 2000 added
Revision 1.4 2000-04-10 15:46:52 marco
* worked all day. probably a lot changed
Revision 1.2 2000/04/05 13:59:10 marco
* added constants for syscall.inc
Revision 1.1 2000/04/05 13:06:24 marco
* Initial version. (copied from linux.) Patch for BSD not ready yeT
Revision 1.5 2000/02/09 16:59:32 peter
* truncated log
Revision 1.4 2000/01/07 16:41:41 daniel
* copyright 2000
Revision 1.3 2000/01/07 16:32:28 daniel
* copyright 2000 added
}

View File

@ -1,161 +1,161 @@
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by Michael Van Canneyt,
member of the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
type
{
Linux system calls take arguments as follows :
i386/m68k:
%eax/%d0 : System call number
%ebx/%d1 : first argument
%ecx/%d2 : second argument
%edx/%d3 : third argumens
%esi/%d3 : fourth argument
%edi/%d4 : fifth argument
That is why we define a special type, with only these arguments
To make it processor independent, we don't give any system dependent
names, but the rather abstract reg1,reg2 etc;
}
SysCallRegs=record
reg1,reg2,reg3,reg4,reg5,reg6 : longint;
end;
PSysCallRegs=^SysCallRegs;
TSysCallRegs=SysCallRegs;
{ The following are records for system calls BSD updated }
dirent = packed record
ino : cardinal; { This is not inode number, but "a number
unique for each file on a filesystem"}
reclen : word;
d_type,
namlen : byte;
name : array [0..255] of char;
end;
pdirent =^dirent;
TDirEnt = dirent;
TDir = packed record
fd : longint;
loc : longint;
size : integer;
buf : pdirent;
{The following are used in libc, but NOT in the linux kernel sources ??}
nextoff: longint;
dd_max : integer; {size of buf. Irrelevant, as buf is of type dirent}
lock : pointer;
dummy : array[0..1023] of char;
end;
PDir =^TDir;
{$packrecords C}
Stat =record {BSD version}
dev, { inode's device }
ino : cardinal; { inode's number }
mode, { inode protection mode }
nlink : word; { number of hard links }
uid, { user ID of the file's owner }
gid, { group ID of the file's group }
dev_t : cardinal; { device type }
atime, { time of last access }
atime_nsec, { nsec of last access }
mtime, { time of last data modification }
mtime_nsec, { nsec of last data modification }
ctime, { time of last file status change }
ctime_nsec : longint; { nsec of last file status change }
size, { file size, in bytes }
blocks : Int64; { blocks allocated for file }
blksze, { optimal blocksize for I/O }
flags, { user defined flags for file }
filegen : cardinal; { file generation number }
lspare : longint;
qspare : array[0..1] of int64;
end;
PStat=^Stat;
TStat=Stat;
Statfs = packed record
spare2, { place holder}
bsize, { fundamental block size}
iosize, { optimal block size }
blocks, { total blocks}
bfree, { blocks free}
bavail, { block available for mortal users}
files, { Total file nodes}
ffree : longint; { file nodes free}
fsid : array[0..1] of longint;
fowner : longint; {mounter uid}
ftype : longint;
fflags : longint; {copy of mount flags}
spare : array [0..1] of longint; { For later use }
fstypename : array[0..15] of char;
mountpoint : array[0..89] of char;
mnfromname : array[0..89] of char;
end;
PStatFS=^StatFS;
TStatFS=StatFS;
fdSet=array[0..7] of longint;{=256 bits}
pfdset=^fdset;
TFDSet=fdset;
timeval = packed record
sec,usec:int64;
end;
ptimeval=^timeval;
TTimeVal=timeval;
timezone = packed record
minuteswest,dsttime:longint;
end;
ptimezone =^timezone;
TTimeZone = timezone;
utsname = packed record
sysname,
nodename,
release,
version,
machine,
domainname : Array[0..64] of char;
end;
PUTSName=^UTSName;
TUTSName=UTSName;
{
{
$Id$
This file is part of the Free Pascal run time library.
Copyright (c) 1999-2000 by Michael Van Canneyt,
member of the Free Pascal development team.
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
type
{
Linux system calls take arguments as follows :
i386/m68k:
%eax/%d0 : System call number
%ebx/%d1 : first argument
%ecx/%d2 : second argument
%edx/%d3 : third argumens
%esi/%d3 : fourth argument
%edi/%d4 : fifth argument
That is why we define a special type, with only these arguments
To make it processor independent, we don't give any system dependent
names, but the rather abstract reg1,reg2 etc;
}
SysCallRegs=record
reg1,reg2,reg3,reg4,reg5,reg6 : longint;
end;
PSysCallRegs=^SysCallRegs;
TSysCallRegs=SysCallRegs;
{ The following are records for system calls BSD updated }
dirent = packed record
ino : cardinal; { This is not inode number, but "a number
unique for each file on a filesystem"}
reclen : word;
d_type,
namlen : byte;
name : array [0..255] of char;
end;
pdirent =^dirent;
TDirEnt = dirent;
TDir = packed record
fd : longint;
loc : longint;
size : integer;
buf : pdirent;
{The following are used in libc, but NOT in the linux kernel sources ??}
nextoff: longint;
dd_max : integer; {size of buf. Irrelevant, as buf is of type dirent}
lock : pointer;
dummy : array[0..1023] of char;
end;
PDir =^TDir;
{$packrecords C}
Stat =record {BSD version}
dev, { inode's device }
ino : cardinal; { inode's number }
mode, { inode protection mode }
nlink : word; { number of hard links }
uid, { user ID of the file's owner }
gid, { group ID of the file's group }
dev_t : cardinal; { device type }
atime, { time of last access }
atime_nsec, { nsec of last access }
mtime, { time of last data modification }
mtime_nsec, { nsec of last data modification }
ctime, { time of last file status change }
ctime_nsec : longint; { nsec of last file status change }
size, { file size, in bytes }
blocks : Int64; { blocks allocated for file }
blksze, { optimal blocksize for I/O }
flags, { user defined flags for file }
filegen : cardinal; { file generation number }
lspare : longint;
qspare : array[0..1] of int64;
end;
PStat=^Stat;
TStat=Stat;
Statfs = packed record
spare2, { place holder}
bsize, { fundamental block size}
iosize, { optimal block size }
blocks, { total blocks}
bfree, { blocks free}
bavail, { block available for mortal users}
files, { Total file nodes}
ffree : longint; { file nodes free}
fsid : array[0..1] of longint;
fowner : longint; {mounter uid}
ftype : longint;
fflags : longint; {copy of mount flags}
spare : array [0..1] of longint; { For later use }
fstypename : array[0..15] of char;
mountpoint : array[0..89] of char;
mnfromname : array[0..89] of char;
end;
PStatFS=^StatFS;
TStatFS=StatFS;
fdSet=array[0..7] of longint;{=256 bits}
pfdset=^fdset;
TFDSet=fdset;
timeval = packed record
sec,usec:int64;
end;
ptimeval=^timeval;
TTimeVal=timeval;
timezone = packed record
minuteswest,dsttime:longint;
end;
ptimezone =^timezone;
TTimeZone = timezone;
utsname = packed record
sysname,
nodename,
release,
version,
machine,
domainname : Array[0..64] of char;
end;
PUTSName=^UTSName;
TUTSName=UTSName;
{
$Log$
Revision 1.6 2000-04-07 20:51:17 marco
* updates.
Revision 1.5 2000/03/17 12:58:57 marco
* some changes to ftruncate based procs. Added a "0" as extra parameter
Revision 1.4 2000/02/04 16:55:47 marco
* Fixed tdir, some params need to be 32-bit
Revision 1.3 2000/02/03 17:05:55 marco
* Some types fixed/ported.
Revision 1.2 2000/02/02 16:45:38 marco
* Typo in STAT record
Revision 1.1 2000/02/02 16:36:09 marco
* Initial version. Copy of linux version, with BSD stat.
Revision 1.7 2000-04-10 15:46:52 marco
* worked all day. probably a lot changed
Revision 1.5 2000/03/17 12:58:57 marco
* some changes to ftruncate based procs. Added a "0" as extra parameter
Revision 1.4 2000/02/04 16:55:47 marco
* Fixed tdir, some params need to be 32-bit
Revision 1.3 2000/02/03 17:05:55 marco
* Some types fixed/ported.
Revision 1.2 2000/02/02 16:45:38 marco
* Typo in STAT record
Revision 1.1 2000/02/02 16:36:09 marco
* Initial version. Copy of linux version, with BSD stat.
}