Index: src/amiga-library.m ================================================================== --- src/amiga-library.m +++ src/amiga-library.m @@ -44,10 +44,12 @@ #ifdef OF_AMIGAOS_M68K # define OF_M68K_REG(reg) __asm__(#reg) #else # define OF_M68K_REG(reg) #endif + +struct Library *DOSBase; /* This always needs to be the first thing in the file. */ int _start() { @@ -377,11 +379,11 @@ lib_null(void) { return NULL; } -bool +bool __saveds of_init(unsigned int version, struct of_libc *libc_, FILE **sF) { #ifdef OF_AMIGAOS_M68K OF_M68K_ARG(struct ObjFWBase *, base, a6) #else @@ -396,10 +398,13 @@ if (version > 1) return false; if (base->initialized) return true; + + if ((DOSBase = OpenLibrary("dos.library", 0)) == NULL) + return false; memcpy(&libc, libc_, sizeof(libc)); __sF = sF; #ifdef OF_AMIGAOS_M68K