# Problem in adding a system call to FreeBSD kernel



## CS_26_OS (Sep 5, 2011)

I'm pretty sure the first step in adding a system call is through /usr/src/sys/kern/syscalls.master, but when I enter, it replies 
	
	



```
permission denied
```
 even though I'm logged in as root.

Any quick ideas?


----------



## doena (Sep 6, 2011)

Check your file permissions, maybe the following line will help you:

```
chmod 644 syscalls.master
```

HTH,
doena


----------



## CS_26_OS (Sep 6, 2011)

Thank you very much for your reply, but i think i figured out what i was missing. I used EDIT /usr/src/sys/kern/syscalls.master command. Now im in the stage of editing the syscalls.master file to add a system call. 

I would like to add a simple hello world system call which prints/outputs [CMD="Hello world!"][/CMD]. Does anyone have a hello world code for FreeBSD?


----------



## victormenegusso (Sep 7, 2011)

CS_26_OS said:
			
		

> Thank you very much for your reply, but i think i figured out what i was missing. I used EDIT /usr/src/sys/kern/syscalls.master command. Now im in the stage of editing the syscalls.master file to add a system call.
> 
> I would like to add a simple hello world system call which prints/outputs [CMD="Hello world!"][/CMD]. Does anyone have a hello world code for FreeBSD?




Good tutorial
http://www.hailang.me/index.php/tec...system-call-first-kernel-service-application/


----------

