The system call "Hello World"
In our docker image, we have a system call that prints "Hello World" from the kernel space.
Its code is in:
~/Downloads/pcs3746-sistemas-operacionais/1/linux/sys_hello_world$ ls
built-in.o Makefile modules.builtin modules.order sys_hello_world.c sys_hello_world.o
Its code is in:
~/Downloads/pcs3746-sistemas-operacionais/1/linux/sys_hello_world$ ls
built-in.o Makefile modules.builtin modules.order sys_hello_world.c sys_hello_world.o
Modify it: change the string to print. That is your first modification in a kernel!
Make init.c as in:
~/Downloads/pcs3746-sistemas-operacionais/1/initramfs$ more init.c
#include "hello_world.h"
int main()
{
while (1) {
hello_world();
}
return 0;
}
This will make a lot of messages from the kernel in your terminal.
When you run it through:
~/Downloads/pcs3746-sistemas-operacionais/1$ ./run.sh
the kernel and rootfs are remade.
Comentários
Postar um comentário