Warning
This page is located in archive.

E Task Project -- System Calls

You have to present the E2 and E3 tasks personally. E0 and E1 are evaluated automatically by the Upload System.

WARNING: This information might be out of date. This version is up-to-date for the summer term 2016.

Task E0: Fibonacci number computation (x86)

Your task is to create a program in assembly language (x86) for computing Fibonacci number without using any other libraries. For reading a value from stdin and printing the result use “int 0x80” system call. Details are in the PDF provided.

cfibo.c -- Reference implementation in C language

cfibo_errchk.c -- Reference implementation in C language with error checking

Makefile for E0 task

Please upload only .s file with assembly code.

E0_Syscalls (PDF)

Task E1: System Calls from Userspace (x86)

Support information and specification (PDF)

Inline assembly info (PDF)

Inline assembly at linux-insides

Create a program that:

  • opens a (text) file named file.txt (in the current directory)
  • reads the first 100 characters from the file (or the whole file if it is shorter)
  • prints the first line read to the stdout (a line is terminated by the EOL character)
  • executes a program /bin/date (using a syscall execve())

Implement the program using system calls only. Do not use standard C libraries – Use gcc parameters -nostdlib -nostdinc for compilation.

Implement the task in one .c file. You can eventually create a few other included files .h. Upload the solution file (single .c in a ZIP archive) using the Upload System.

If you copied the code from PDF slides and have not been able to compile it, you probably need to correct the quotes around the memory keyword.

Task E2: Nova OS, user/kernel context switch, execution of ELF executable

Support materials and E2 task specs (PDF)

OS kernel source (tar.gz)

GCC inline assembler howto (online)

Upload only changed files to the Upload System, i.e. only ec.cc.

  • If you cannot compile the code, you probably need the g++ compiler (package) installed.
  • If the hypervisor does not execute, you probably need the qemu emulator (package) installed.
If you have lost your mouse cursor, it has been grabbed by the QEMU console. Press Ctrl+Alt to release it.

Task E3: User processes, system calls from kernel side

courses/ae3b33osd/prj_e.txt · Last modified: 2016/05/05 13:47 by bursam