List of commits:
Subject Hash Author Date (UTC)
modules properly loaded ac79794945662bad9e97562c479dea5afe455687 Sylvain BERTRAND 2011-12-26 22:08:54
ulinux patterns: insert a kernel module ed879829ce6c44b77bddcd9c106a106261f47301 Sylvain BERTRAND 2011-12-26 21:29:33
ulinux dir_parse pattern 63cc7acc186efc291a76255e97d86e80901174e5 Sylvain BERTRAND 2011-12-26 02:24:55
ulinux improvements and more patterns a458c52301d3a34e8b51794fea7c1cb06c1c34f8 Sylvain BERTRAND 2011-12-22 22:09:06
ulinux patterns:network server 60c167bcd530f95d0a57189035620c3bc80f1e34 Sylvain BERTRAND 2011-12-20 00:39:56
ulinux cleanup and samples 92c893f28ef42f11943c0bf80a037a5b5f34ebef Sylvain BERTRAND 2011-12-16 01:51:22
uevent listener 55657699f291575139858aec466340e7624cd66a Sylvain BERTRAND 2011-12-15 18:01:06
uevent monitor e241bd4db4af8510902a5c606eee0e1e2dbdecda Sylvain BERTRAND 2011-12-13 00:37:45
block signals 91772917669645b5634563d0c06e361c87cf3e84 Sylvain BERTRAND 2011-12-09 17:04:34
initial commit 5310fde2d021e3505f8f1d5d9091726c236967ec Sylvain BERTRAND 2011-12-07 11:29:18
Commit ac79794945662bad9e97562c479dea5afe455687 - modules properly loaded
Author: Sylvain BERTRAND
Author date (UTC): 2011-12-26 22:08
Committer name: Sylvain BERTRAND
Committer date (UTC): 2011-12-26 22:08
Parent(s): ed879829ce6c44b77bddcd9c106a106261f47301
Signing key:
Tree: 345dc520f20fec54045bbab60c63405095e82028
File Lines added Lines deleted
init.c 1 38
modules.c 11 6
File init.c changed (mode: 100644) (index d5de9ab..98b7f81)
8 8 #include <ulinux/types.h> #include <ulinux/types.h>
9 9 #include <ulinux/error.h> #include <ulinux/error.h>
10 10 #include <ulinux/fs.h> #include <ulinux/fs.h>
11 #include <ulinux/dirent.h>
11 12 #include <ulinux/socket/socket.h> #include <ulinux/socket/socket.h>
12 13 #include <ulinux/socket/netlink.h> #include <ulinux/socket/netlink.h>
13 14 #ifdef DEBUG #ifdef DEBUG
 
... ... static void sigs_setup(void)
41 42 OUTC("done\n"); OUTC("done\n");
42 43 } }
43 44
44 static void proc_mount(void)
45 {
46 OUTC(PRE "mounting proc...");
47 k_l r=sysc(mount,5,"proc","/proc","proc",K_MS_NOSUID|K_MS_NODEV|K_MS_NOEXEC,
48 0);
49 if(K_ISERR(r)){
50 OUT("ERROR:%ld\n",r);
51 sysc(exit_group,1,-1);
52 }
53 OUTC("done\n");
54 }
55
56 static void root_remount_rw(void)
57 {
58 OUTC(PRE "remounting / as RW...");
59 k_l r=sysc(mount,5,0,"/",0,K_MS_REMOUNT,0);
60 if(K_ISERR(r)){
61 OUT("ERROR:%ld\n",r);
62 sysc(exit_group,1,-1);
63 }
64 OUTC("done\n");
65 }
66
67 static void sysfs_mount(void)
68 {
69 OUTC(PRE "mounting sysfs...");
70 k_l r=sysc(mount,5,"sysfs","/sys","sysfs",K_MS_NOSUID|K_MS_NODEV|K_MS_NOEXEC,
71 0);
72 if(K_ISERR(r)){
73 OUT("ERROR:%ld\n",r);
74 sysc(exit_group,1,-1);
75 }
76 OUTC("done\n");
77 }
78
79 45 void _start(void) void _start(void)
80 46 { {
81 47 # ifdef DEBUG # ifdef DEBUG
 
... ... void _start(void)
87 53 g_dprintf_buf=dprintf_buf; g_dprintf_buf=dprintf_buf;
88 54 # endif # endif
89 55 sigs_setup(); sigs_setup();
90 proc_mount();
91 root_remount_rw();
92 sysfs_mount();
93 56 uevent_setup(); uevent_setup();
94 57 modules_load(); modules_load();
95 58 uevent_recv(); uevent_recv();
File modules.c changed (mode: 100644) (index 7dd1634..9b1a728)
20 20 #include "globals.h" #include "globals.h"
21 21 #include "modules_list.h" #include "modules_list.h"
22 22
23
24 23 static void module_load(k_u8 *m) static void module_load(k_u8 *m)
25 24 { {
26 k_l fd=sysc(open,3,m,K_O_RDONLY,0);
25 k_i fd=(k_i)sysc(open,3,m,K_O_RDONLY,0);
27 26 if(K_ISERR(fd)){ if(K_ISERR(fd)){
28 OUTC("unable to open module\n");
27 OUT("unable to open module(%ld)\n",fd);
29 28 goto err; goto err;
30 29 } }
31 30
32 31 struct k_stat m_stat; struct k_stat m_stat;
33 32 k_l r=sysc(fstat,2,fd,&m_stat); k_l r=sysc(fstat,2,fd,&m_stat);
34 33 if(K_ISERR(r)){ if(K_ISERR(r)){
35 OUTC("unable to stat module\n");
34 OUT("unable to stat module(%ld)\n",r);
36 35 goto err; goto err;
37 36 } }
37 OUT("size=%lu...",m_stat.st_size);
38 38
39 39 k_l addr=sysc(mmap,6,0,m_stat.st_size,K_PROT_READ, k_l addr=sysc(mmap,6,0,m_stat.st_size,K_PROT_READ,
40 40 K_MAP_PRIVATE|K_MAP_POPULATE,fd,0); K_MAP_PRIVATE|K_MAP_POPULATE,fd,0);
41 41 if(K_ISERR(addr)){ if(K_ISERR(addr)){
42 OUTC("unable to mmap module\n");
42 OUT("unable to mmap module(%ld)\n",addr);
43 goto err;
44 }
45
46 r=sysc(init_module,3,addr,m_stat.st_size,"");
47 if(K_ISERR(r)){
48 OUT("unable init module(%ld)\n",r);
43 49 goto err; goto err;
44 50 } }
45 51 return; return;
46
47 52 err: err:
48 53 sysc(exit_group,1,-1); sysc(exit_group,1,-1);
49 54 } }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/cinitramfs

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/cinitramfs

Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/cinitramfs

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main