comparison kernel/src/syscall.c3 @ 393:6ae782a085e0

Added init program
author Windel Bouwman
date Sat, 17 May 2014 21:17:40 +0200
parents b4ac28efcdf4
children
comparison
equal deleted inserted replaced
392:bb4289c84907 393:6ae782a085e0
7 import arch; 7 import arch;
8 import scheduler; 8 import scheduler;
9 import process; 9 import process;
10 10
11 11
12 /* System call numbers:
13 */
12 const int SendMsg = 1; 14 const int SendMsg = 1;
13 const int ReceiveMsg = 2; 15 const int ReceiveMsg = 2;
14 const int Reboot = 3; 16 const int Reboot = 3;
15 17
16 18
17 // System call handlers. System calls are made from user space. 19 // System call handlers. System calls are made from user space.
18 function void handle_system_call(int callId, int a, int b) 20 function void handle_system_call(int callId, int a, int b)
19 { 21 {
20 // Main entry, check what to do here 22 // Main entry, check what to do here
21 if (callId == 1) 23 if (callId == SendMsg)
22 { 24 {
23 handle_send_msg(); 25 handle_send_msg();
24 var process.process_t* proc; 26 var process.process_t* proc;
25 proc = process.byId(a); 27 proc = process.byId(a);
26 // proc.setMessage(); 28 // proc.setMessage();