Browse Source

A2Loader for Solaris port added

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7326 8c9fc860-2736-0410-a75d-ab315db34111
eth.guenter 7 years ago
parent
commit
61603e4c97
3 changed files with 11 additions and 7 deletions
  1. 9 5
      UnixAos/boot/A2Loader.c
  2. BIN
      UnixAos/boot/A2Loader.elf
  3. 2 2
      UnixAos/boot/Makefile.solaris

+ 9 - 5
UnixAos/boot/A2Loader.c

@@ -28,19 +28,21 @@
 typedef void (*OberonProc)();
 typedef void *addr;
 
-typedef struct {
-    char id[32];		/* must be coreID */
-    void *displacement;		/* must be address of buf */
+typedef struct {  /* cf. Glue.EntryPoint */
+    char id[32];		/* must match coreID */
+    void *displacement;		/* must match address of buf */
     OberonProc entry;		/* Glue.Init0 */
     addr *dlopenaddr;
+    addr *dlcloseaddr;
     addr *dlsymaddr;
     int  *argc;
     addr *argv;
+    addr *env;
 } *A2Header;
 
-char *coreID = "Solaris32G.core";
+char *coreID = "Oberon32G.core";
 
-int main( int argc, char *argv[] ) {
+int main( int argc, char *argv[], char *env[] ) {
    int r, n, fd;
    size_t fsize;
    struct stat sb;
@@ -71,8 +73,10 @@ int main( int argc, char *argv[] ) {
       exit( 3 );
    }
    *(header->dlopenaddr) = dlopen;
+   *(header->dlcloseaddr) = dlclose;
    *(header->dlsymaddr) = dlsym;
    *(header->argc) = argc;
    *(header->argv) = argv;
+   *(header->env) = env;
    header->entry();
 }

BIN
UnixAos/boot/A2Loader.elf


+ 2 - 2
UnixAos/boot/Makefile.solaris

@@ -4,14 +4,14 @@ CC=gcc  -m32
 CFLAGS  = -DSOLARIS
 LDFLAGS = -lthread -lX11 -ldl -lrt -lm
 
-all:	A2Loader.elf aos.solaris
+all:	A2Loader.elf aos.solaris 
+	rm -f *.o
 
 A2Loader.elf:	A2Loader.c
 	$(CC) -ldl -o A2Loader.elf A2Loader.c
 
 aos.solaris:	aos.o Threads.solaris.o
 	$(CC) -s -o aos.solaris aos.o Threads.solaris.o $(LDFLAGS)
-	rm -f *.o 
 
 aos.o:	aos.c
 	$(CC) -c $(CFLAGS) aos.c