FINAL REPORT OF THE POPLOG PORT TO DARWIN

BACKGROUND

The Poplog port to Darwin was proposed as a preliminary stage in porting poplog to OS X. The goal in this stage, was to modify the system calls and to rebuild Poplog on a system with the same features of OS X. These files will be merged with some other files modified to generate assembly code that can be recognized by Mac OS X, the source code will then be cross-compiled on a machine running Poplog and the generated assembly files transfered to Mac OS X to rebuild the system on it.


GENERAL OBJECTIVE OF THE DOCUMENT

To notify the results obtained in the Poplog port to Darwin stage.

PORT FEATURES

Target Machine: Open Darwin 7.2.1

Host Machine: Linux Red Hat 9.0


Files Reviewed in the Host Machine:


Note: The $popsrc directory is poplog/v15.53e/pop/src and the $popexternlib directory is poplog/v15.53e/pop/extern/lib.

File Name

Directory

Modified Aspects

sysdefs.p

$popsrc/syscomp/

Options for Darwin Os (Name, Posix version, Type, etc) were added.

os_common.p

$popsrc/syscomp/

Library definitions and assembler command.

asmout.p

$popsrc/syscomp/

The right shift instruction was changed for a sum instruction, so that the generated assembler code could be compiled on Darwin.

genproc.p

$popsrc/syscomp/

The right character to specify comments in Darwin Assembler was added.

external.ph

$popsrc/

Darwin dynamic libraries options.

devio.p

$popsrc/

Darwin Termio options and getpgrp system call for Darwin 7.2.1

pop_malloc_min_alloc.p

$popsrc/

none

sig_stop.p

$popsrc/

none

sys_asinc_input.p

$popsrc/

none

syscreate.p

$popsrc/

none

sysdate.p

$popsrc/

Recognition of the time_eval structure on Darwin

sysdelete.p

$popsrc/

none

sysexecute.p

$popsrc/

none

sys_file_move.p

$popsrc/

Recognition of the rename system call like Berkeley.

sysfileok.p

$popsrc/

MAXNAMLEN value for Darwin 7.2.1

sys_file_stat.p

$popsrc/

none

sysfork.p

$popsrc/

none

sys_host_id.p

$popsrc/

The gethostid system call on Darwin 7.2.1 is now accepted.

sys_host_name.p

$popsrc/

none

sys_input_waiting.p

$popsrc/

Darwin 7.2.1 system calls that check if there are any devices waiting for an input were modified like the equivalent system calls in Linux.

sys_io_control.p

$popsrc/

none

sysio.p

$popsrc/

none

sysisdirectory.p

$popsrc/

none

syslink.p

$popsrc/

Accepting the syslimk system call on Darwin 7.2.1

sysobey.p

$popsrc/

none

sysopen.p

$popsrc/

Accepting the readlink system call on Darwin 7.2.1

syspipe.p

$popsrc/

none

sys_real_time.p

$popsrc/

none

systime.p

$popsrc/

none

sysutil.p

$popsrc/

To calculate the USR_STACK macro, and to recognize system calls getrlimit, mprotect, getpwnam and getpwid system calls on Darwin 7.2.1.

termcap.p

$popsrc/

To accept the output speed like the value in its TMIO_OSPEED attribute on Darwin 7.2.1

unixdefs.ph

$popsrc/

Values for the Stabs, Direct and Timezone structures on Darwin 7.2.1

unix_dir.p

$popsrc/

To accept the opendir, closedir and readdir system calls on Darwin 7.2.1

unixextern.p

$popsrc/

none

unixfmatch.p

$popsrc/

none

unix_select.ph

$popsrc/

The fd_mask definition and FD_SIZE macro value for Darwin 7.2.1 were added.

unix_tty.ph

$popsrc/

The values for the respective macros according to the termios.h file on Darwin 7.2.1 were added.

amisc.s

$popsrc/

The sscab instruction was changed for the scasb instruction.

amove.s

$popsrc/

The scmpb, scmpw, scmpl, smovl, smovb, sstob, sstol instruction were changed for the cmpsb, cmpdw, movsl, movsb, stosb and stosl respectively.

aprocess.s

$popsrc/

The smovl, sstol an slodl instruction were replaced for the movsl, stosl and lodsl respectively

aprolog.s

$popsrc/

The slodl instruction assembler was changed for the lodsl instruction.

aarith.s

$popsrc/

The slodl and sstol instructions were changed for the lodsl and stosl instructions.



Files Modified in the Target Machine


File Name

Directory

Modified Aspects

c_core.h

$popexternlib

The UNIX macro is defined if the APPLE_CC macro is defined (this macro is defined if the Operating System is Mac OS X or Darwin).

c_core.c

$popexternlib

If the macro APPLE_CC was defined then the same _pop_errsig_handler procedure of Linux is used.

mklibpop

$popexternlib

The gcc flags according to Darwin and the regconition of the getpgrp system call without parameters were added.



CONCLUSION

Although the preliminary stages to build the Poplog system on Darwin Operating System were achieved, the final goal was not satisfied due to a problem in the Darwin assembler. Therefore, the Poplog Directory and its modified source code are attached to this document, but not the port itself.