Changeset 445 for trunk/user/init


Ignore:
Timestamp:
May 29, 2018, 9:27:23 AM (4 years ago)
Author:
alain
Message:

Restructure the mini_libc.

Location:
trunk/user/init
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/user/init/Makefile

    r444 r445  
    11#########################################################################
    2 # Makefile for the ALMOS-MKH "init" application
     2# Makefile for the "init" application
    33#########################################################################
    44
     
    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)  \
    1717           -I$(LIBALMOSMKH_INCLUDE) \
    1818           -I$(SHARED_INCLUDE)
    1919
    2020compile : dirs build/init.elf
     21
    2122build/init.elf : $(OBJS) init.ld
    22         $(LD) -o $@ -T init.ld $(OBJS) -nostdlib -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmos-mkh -lpthread -lc
     23        $(LD) -o $@ -T init.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) -lc -lpthread -lalmosmkh -lpthread -lc
    2324        $(DU) -D $@ > $@.txt
    2425
  • trunk/user/init/init.c

    r444 r445  
    1717#include <stdio.h>
    1818#include <pthread.h>
    19 #include <almos-mkh.h>
    20 #include <assert.h>
     19#include <almosmkh.h>
    2120#include <sys/wait.h>
    2221
    2322#define DEBUG_PROCESS_INIT    0
    2423
    25 // TODO make the cxy computation portable [AG]
     24// TODO make the cxy computation portable
     25// and avoid this TSAR specific define [AG]
     26
    2627#define CXY_FROM_XY( x , y )  ((x<<4) + y)
     28
     29// TODO improve the get_config() syscall to return nb_txt_channels
     30// and avoid the hard_config include [AG]
    2731
    2832//////////
     
    3741
    3842    // check number of TXT channels
    39     assert( NB_TXT_CHANNELS > 1 );
     43    if( NB_TXT_CHANNELS < 2 )
     44    {
     45        printf("\n[ERROR] in init process : number of TXT channels must be larger than 1\n");
     46        exit( EXIT_FAILURE );
     47    }
    4048
    4149    // create the KSH processes (one per user terminal)
     
    7381             display_string( string );
    7482        }
     83
     84        // INIT wait CHILD[i] process deletion before creating KSH[i+1]
     85        // int n;
     86        // for( n = 0 ; n < 100000 ; n++ ) asm volatile ( "nop" );
     87        wait( &status );
    7588    }
    7689 
Note: See TracChangeset for help on using the changeset viewer.