Changeset 444 for trunk/user


Ignore:
Timestamp:
May 16, 2018, 8:31:35 PM (4 years ago)
Author:
satin@…
Message:

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

Location:
trunk/user
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/idbg/Makefile

    r442 r444  
    1111OBJS = build/idbg.o
    1212
    13 INCLUDES = -I. -I$(LIBC_INCLUDE)
     13INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBALMOSMKH_INCLUDE) -I$(SHARED_INCLUDE) -I$(LIBPTHREAD_INCLUDE)
    1414
    1515compile: dirs build/idbg.elf
    1616
    1717build/idbg.elf : $(OBJS) idbg.ld
    18         $(LD) -o $@ -T idbg.ld $(OBJS) -nostdlib -L$(LIBC) -lc
     18        $(LD) -o $@ -T idbg.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH)  -lpthread -lc -lalmos-mkh -lc -lpthread -lc -lalmos-mkh -lpthread -lc
    1919        $(DU) -D $@ > $@.txt
    2020
  • trunk/user/idbg/idbg.c

    r442 r444  
    1111#include <stdlib.h>
    1212#include <stdio.h>
    13 #include <shared_syscalls.h>
     13#include <almos-mkh.h>
    1414
    1515///////////
  • trunk/user/init/Makefile

    r440 r444  
    1111OBJS = build/init.o
    1212
    13 INCLUDES = -I.                     \
    14            -I../..                 \
    15            -I$(LIBC_INCLUDE)/      \
    16            -I$(LIBPTHREAD_INCLUDE)
     13INCLUDES = -I.                   \
     14           -I../..               \
     15           -I$(LIBC_INCLUDE)/    \
     16           -I$(LIBPTHREAD_INCLUDE) \
     17           -I$(LIBALMOSMKH_INCLUDE) \
     18           -I$(SHARED_INCLUDE)
    1719
    1820compile : dirs build/init.elf
    1921build/init.elf : $(OBJS) init.ld
    20         $(LD) -o $@ -T init.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -lc -lpthread
     22        $(LD) -o $@ -T init.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmos-mkh -lpthread -lc
    2123        $(DU) -D $@ > $@.txt
    2224
  • trunk/user/init/init.c

    r442 r444  
    1313
    1414#include <hard_config.h>
    15 
     15#include <unistd.h>
    1616#include <stdlib.h>
    1717#include <stdio.h>
    1818#include <pthread.h>
     19#include <almos-mkh.h>
     20#include <assert.h>
     21#include <sys/wait.h>
    1922
    2023#define DEBUG_PROCESS_INIT    0
     
    5457        {
    5558            // CHILD[i] process exec process KSH[i]
    56             ret_exec = exec( "/bin/user/ksh.elf" , NULL , NULL );
     59            ret_exec = execve( "/bin/user/ksh.elf" , NULL , NULL );
    5760
    5861            if ( ret_exec )   // error in exec             
     
    139142            {
    140143                // CHILD process exec process KSH
    141                 ret_exec = exec( "/bin/user/ksh.elf" , NULL , NULL );
     144                ret_exec = execve( "/bin/user/ksh.elf" , NULL , NULL );
    142145
    143146                if ( ret_exec )   // error in exec             
  • trunk/user/ksh/Makefile

    r440 r444  
    1010OBJS = build/ksh.o
    1111
    12 INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE)
     12INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE) -I$(LIBALMOSMKH_INCLUDE) -I$(SHARED_INCLUDE)
    1313
    1414compile: dirs build/ksh.elf
    1515build/ksh.elf : $(OBJS) ksh.ld
    16         $(LD) -o $@ -T ksh.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -lc -lpthread
     16        $(LD) -o $@ -T ksh.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lpthread -lc -lalmos-mkh -lc -lpthread -lc
    1717        $(DU) -D $@ > $@.txt
    1818
  • trunk/user/ksh/ksh.c

    r442 r444  
    1010#include <stdlib.h>
    1111#include <string.h>
    12 #include <shared_syscalls.h>
     12#include <sys/wait.h>
     13#include <signal.h>
     14#include <unistd.h>
     15#include <almos-mkh.h>
    1316
    1417#define CMD_MAX_SIZE   (256)    // max number of characters in one command
     
    425428    {
    426429        // CHILD process exec NEW process
    427         ret_exec = exec( pathname , NULL , NULL );
     430        ret_exec = execve( pathname , NULL , NULL );
    428431
    429432        // this is only executed in case of exec failure
  • trunk/user/pgcd/Makefile

    r440 r444  
    1111OBJS = build/pgcd.o
    1212
    13 INCLUDES = -I. -I$(LIBC_INCLUDE)
     13INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBALMOSMKH_INCLUDE) -I$(SHARED_INCLUDE) -I$(LIBPTHREAD_INCLUDE)
    1414
    1515compile: dirs build/pgcd.elf
    1616
    1717build/pgcd.elf : $(OBJS) pgcd.ld
    18         $(LD) -o $@ -T pgcd.ld $(OBJS) -nostdlib -L$(LIBC) -lc
     18        $(LD) -o $@ -T pgcd.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBALMOSMKH) -L$(LIBPTHREAD) -lalmos-mkh -lc -lalmos-mkh -lpthread -lc
    1919        $(DU) -D $@ > $@.txt
    2020
    2121build/pgcd.o : pgcd.c
    22         $(CC) $(INCLUDES) -L$(LIBC) $(CFLAGS) -c -o  $@ $<
     22        $(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<
     23        $(DU) -D $@ > $@.txt
    2324
    2425dirs:
  • trunk/user/pgcd/pgcd.c

    r442 r444  
    1010#include <stdlib.h>
    1111#include <stdio.h>
    12 
     12#include <almos-mkh.h>
    1313
    1414///////////
  • trunk/user/sort/Makefile

    r440 r444  
    1111OBJS = build/sort.o
    1212
    13 INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE)
     13INCLUDES = -I. -I$(LIBC_INCLUDE) -I$(LIBPTHREAD_INCLUDE) -I$(LIBALMOSMKH_INCLUDE) -I$(SHARED_INCLUDE)
    1414
    1515compile: dirs build/sort.elf
    1616
    1717build/sort.elf : $(OBJS) sort.ld
    18         $(LD) -o $@ -T sort.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -lc -lpthread
     18        $(LD) -o $@ -T sort.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lpthread -lalmos-mkh -lc
    1919        $(DU) -D $@ > $@.txt
    2020
  • trunk/user/sort/sort.c

    r442 r444  
    2424#include <stdio.h>
    2525#include <stdlib.h>
    26 #include <malloc.h>
    2726#include <pthread.h>
     27#include <almos-mkh.h>
    2828
    2929#define ARRAY_LENGTH        0x400    // 1024 values
Note: See TracChangeset for help on using the changeset viewer.