Project design
- C course
- Expert
- Lesson 43/47
- 6 min
Design the skeleton of the expert final mini app.
Project: Mini system app
In this five-lesson project you'll build a mini system app. It combines three topics from the expert section: a kernel module (kernel_init and syscall), a compiler component (parse_command for command parsing) and a security layer (security_check for buffer overflow checks).
Each lesson adds a piece; the previous lesson's solution is included in the starting code. In the first lesson you lay out the module skeleton: three function declarations and main. In the following lessons you add the kernel, the compiler and the security layer. In the final lesson you combine all pieces into a working app.
Module skeleton
The skeleton of a C project consists of function declarations (prototypes) and main. Declarations tell the compiler each function's signature in advance; definitions come later.
In this project you'll declare three functions: void kernel_init(void);, int parse_command(const char *cmd); and int security_check(const char *buf, int len);. The main function is the program's entry point; everything is called from here. Declarations come before main; definitions may come after. This structure improves readability.
Practice Write the project skeleton
Write three function declarations: void kernel_init(void);, int parse_command(const char *cmd);, int security_check(const char *buf, int len);. Write int main(void) that calls printf("Proje başladı\n").
Starter code
#include <stdio.h>
#include <string.h>
// üç modülün bildirimlerini yaz:
// kernel_init, parse_command, security_check
// main: "Proje başladı" yazdırSample solution
#include <stdio.h>
#include <string.h>
void kernel_init(void);
int parse_command(const char *cmd);
int security_check(const char *buf, int len);
int main(void) {
printf("Proje başladı\n");
return 0;
}Expected output
Proje başladı
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which three topics does this project combine?
- Only compiler
- Only kernel
- Kernel + compiler + security Correct answer
- Only security
Explanation: The project combines three expert topics: kernel, compiler and security.
2 Complete the kernel_init declaration
void ____(void);
void kernel_init(void);
Explanation: void kernel_init(void); is the declaration of the kernel-init function.
3 Match module to purpose
| Term | Meaning |
|---|---|
kernel_init |
Kernel init |
parse_command |
Command parsing |
security_check |
Overflow check |
main |
Entry point |