Binutils gets no changes.
For GCC, add these lines to the end of the gcc/config/myos.h
GCC suggests modifying libgcc/config.host in a similar manner to gcc/config.gcc
Code: Select all
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s \
crtn.o%s"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!shared: \
%{!symbolic: \
%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\
crti.o%s \
crtbegin.o%s"
Modify libgloss/configure.in and modify near the beginning so it looks like this.
Code: Select all
AC_CONFIG_SUBDIRS(libnosys)
case "${target}" in
*-*-myos*)
AC_CONFIG_SUBDIRS(myos)
config_testsuite=true
;;
i[[3456]]86-*-elf* | i[[3456]]86-*-coff*)
AC_CONFIG_SUBDIRS(i386)
config_testsuite=true
;;
Modify the libgloss/myos/Makefile.in and replace libnosys with libmyos.
Also modify this line to say the following.
Code: Select all
OUTPUTS = libmyos.a crti.o crtn.o
Code: Select all
.global _start
.extern main
.extern exit
_start:
call _init
call main
call exit
.wait: hlt
jmp .wait
CRTN.S
Code: Select all
.section .init,"ax"
ret
.section .fini,"ax"
ret
Code: Select all
.section .init,"ax"
.align 1
.globl _init
_init:
.section .fini,"ax"
.align 1
.globl _fini
_fini:
For usermode programs, nothing is required besides the usual command (system name)-gcc source.c.
I didn't want to modify the page myself. Let me know what you guys think.