File init.c changed (mode: 100644) (index b8a86e9..60a0113) |
11 |
11 |
#include <ulinux/file.h> |
#include <ulinux/file.h> |
12 |
12 |
#include <ulinux/stat.h> |
#include <ulinux/stat.h> |
13 |
13 |
#include <ulinux/mmap.h> |
#include <ulinux/mmap.h> |
|
14 |
|
#include <ulinux/signal/signal.h> |
14 |
15 |
|
|
15 |
16 |
#include <stdarg.h> |
#include <stdarg.h> |
16 |
17 |
#include <ulinux/utils/ascii/string/vsprintf.h> |
#include <ulinux/utils/ascii/string/vsprintf.h> |
|
... |
... |
k_u8 *g_dprintf_buf; |
24 |
25 |
k_i g_console; |
k_i g_console; |
25 |
26 |
#endif |
#endif |
26 |
27 |
|
|
|
28 |
|
static void sigs_setup(void) |
|
29 |
|
{ |
|
30 |
|
k_ul mask=(~0); |
|
31 |
|
k_l r=sysc(rt_sigprocmask,4,K_SIG_BLOCK,&mask,0,sizeof(mask)); |
|
32 |
|
if(K_ISERR(r)){ |
|
33 |
|
OUTC(PRE "ERROR:unable to block all signals (except KILL and STOP ;) )\n"); |
|
34 |
|
sysc(exit_group,1,-1); |
|
35 |
|
} |
|
36 |
|
} |
|
37 |
|
|
27 |
38 |
void _start(void) |
void _start(void) |
28 |
39 |
{ |
{ |
29 |
40 |
# ifdef DEBUG |
# ifdef DEBUG |
30 |
|
k_l r=sysc(open,3,"/dev/console",K_O_WRONLY,0); |
|
31 |
|
if(K_ISERR(r)) sysc(exit_group,1,-1); |
|
32 |
|
g_console=(k_i)r; |
|
33 |
|
r=sysc(mmap,6,0, K_PAGE_SIZE, K_PROT_READ|K_PROT_WRITE, |
|
|
41 |
|
k_l rl=sysc(open,3,"/dev/console",K_O_WRONLY,0); |
|
42 |
|
if(K_ISERR(rl)) sysc(exit_group,1,-1); |
|
43 |
|
g_console=(k_i)rl; |
|
44 |
|
rl=sysc(mmap,6,0, K_PAGE_SIZE, K_PROT_READ|K_PROT_WRITE, |
34 |
45 |
K_MAP_PRIVATE|K_MAP_ANONYMOUS|K_MAP_POPULATE,0,0); |
K_MAP_PRIVATE|K_MAP_ANONYMOUS|K_MAP_POPULATE,0,0); |
35 |
|
if(K_ISERR(r)){ |
|
36 |
|
OUTC(PRE "ERROR: unable to mmap memory for formatted output\n"); |
|
|
46 |
|
if(K_ISERR(rl)){ |
|
47 |
|
OUTC(PRE "ERROR:unable to mmap a memory page for formatted output\n"); |
37 |
48 |
sysc(exit_group,1,-1); |
sysc(exit_group,1,-1); |
38 |
49 |
} |
} |
39 |
|
g_dprintf_buf=(k_u8*)r;//just one page should be enough for formatted output |
|
|
50 |
|
g_dprintf_buf=(k_u8*)rl;//just one page should be enough for formatted output |
40 |
51 |
# endif |
# endif |
|
52 |
|
sigs_setup(); |
41 |
53 |
modules_load(); |
modules_load(); |
42 |
54 |
sysc(exit_group,1,0); |
sysc(exit_group,1,0); |
43 |
55 |
} |
} |
File modules.c changed (mode: 100644) (index 5c828b2..63757dd) |
20 |
20 |
#include "globals.h" |
#include "globals.h" |
21 |
21 |
#include "modules_list.h" |
#include "modules_list.h" |
22 |
22 |
|
|
|
23 |
|
|
23 |
24 |
static void module_load(k_u8 *m) |
static void module_load(k_u8 *m) |
24 |
25 |
{ |
{ |
25 |
26 |
k_l fd=sysc(open,3,m,K_O_RDONLY,0); |
k_l fd=sysc(open,3,m,K_O_RDONLY,0); |
File ulinux/archs/x86_64/signal/signal.h changed (mode: 100644) (index 58a3d19..91a135a) |
1 |
|
//********************************************************************************************** |
|
|
1 |
|
//****************************************************************************** |
2 |
2 |
//*this code is protected by the GNU affero GPLv3 |
//*this code is protected by the GNU affero GPLv3 |
3 |
|
//*author:Sylvain BERTRAND (sylvain.bertrand AT gmail dot com) |
|
4 |
|
//********************************************************************************************** |
|
|
3 |
|
//*author:Sylvain BERTRAND <sylvain.bertrand AT gmail dot com> |
|
4 |
|
//* <digital.ragnarok AT gmail dot com> |
|
5 |
|
//****************************************************************************** |
5 |
6 |
#ifndef ULINUX_ARCH_SIGNAL_SIGNAL_H |
#ifndef ULINUX_ARCH_SIGNAL_SIGNAL_H |
6 |
7 |
#define ULINUX_ARCH_SIGNAL_SIGNAL_H |
#define ULINUX_ARCH_SIGNAL_SIGNAL_H |
7 |
8 |
#define K_SIGHUP 1 |
#define K_SIGHUP 1 |
|
38 |
39 |
#define K_SIGPWR 30 |
#define K_SIGPWR 30 |
39 |
40 |
#define K_SIGSYS 31 |
#define K_SIGSYS 31 |
40 |
41 |
#define K_SIGUNUSED 31 |
#define K_SIGUNUSED 31 |
|
42 |
|
#define K_SIGRTMIN 32 |
|
43 |
|
#define K_SIGRTMAX 64 |
41 |
44 |
#endif |
#endif |