Design and implement a REAL embedded operating system
- Website
- Samples & Base Code
- Embedded and Real-time Operating Systems by K.C. Wang
- Design and Implementation of the MTX Operating System by K.C. Wang
- Booter
- LCD Driver
- Timer and KBD Drivers
- Midterm
- User Mode Commands and Syscalls
- Fork & Exec
- Buffer Management
- Last
Develop our own User Command Program
System Call | Function | E & RT OS |
---|---|---|
init | fork several login processes on serial ports | pg 321 |
login | handle login processes | pg 322 |
ls [filename] | list cwd or filename | pg 299 |
cat [filename] | display file contents or stdin to screen | - |
more [filename] | display file one page/line at a time | - |
grep pattern [filename] | prints each line matching the pattern | - |
l2u [file1 file2] | convert lower to upper case | - |
cp [file1 file2] | copy files or directories | - |
sh | executable program, support I/O redirections and pipes | pg 365 |
sdimage:
/---|
|----bin/ : All binary executables are in /bin
|
|---dev/ : special files tty0 c 4 0
| fd0 b 2 0
| sdc b 3 0
| ttyS0 c 5 0
| ttyS1 c 5 1
| ttyS2 c 5 2
|---etc/ : passwd file
|
|---boot/: bootable EOS kernels
|
|---user/: users HOME directories
mku: script to generate a NEW user mode command from test.c and copy to /bin of sdimage
string.c: bcopy(), memcpy(), memset(), memcmp(), strcmp(), strcpy(), strlen(), strcat(), atoi(), etc
ucode.c: rest of user commands we don't have to write
uio.c: printk(char*); prints(char*), printi(int), printu(u32), printx(u32), printc(char)
Ubuntu Linux version 20.04
-
Install ARM Cross Compiling packages
sudo apt-get install gcc-arm-none-eabi sudo apt-get install qemu-system-arm
-
Clone the repository
git clone https://github.com/k-radford/CptS460.git
-
Start Kernel
cd CptS460/LAST ./mku test
-
Run a Command
##################### KATES's HELP MENU ##################### # ls cd pwd cat more cp mv > >> # # mkdir rmdir creat rm chmod chown lpr < | # ############################################################# SH 1 (input command): _
Command | Expected Results | Observed | Weight |
---|---|---|---|
Boot up | P1 (init) create login processes | show 3 logins: console, ttys0, ttys1 | 10 |
login | login from tty0 | user=root pass=12345, show root logged in and sh2 | 10 |
login from ttyS0, ttyS1 | show can login | 5 | |
logout; login again | logout from console and ttys0, show another login | 5 | |
Control-C | sh must not die | on tty0 or console only | 5 |
ls |
SAME as ls -l in Linux | ls; ls /bin | 10 |
cat |
show input lines from stdin | enter keys from keyboard, cat echos | 5 |
cat f |
show contents of file f | 5 | |
cat f1 > f2; ls |
show f1 and f2 SAME size | 10 | |
grep abcd |
grep for abcd from stdin | 5 | |
grep printf f |
show lines with "printf" ONLY | 5 | |
more f |
pause after display ONE screen, Enter: advance by line, Space: advance by screen | MUST pause to let user input keys | 5 |
cat f \ more |
must PAUSE for Enter/Space | show can stop to allow user input | 10 |
cat f \ grep printf |
show lines with printf | ONE Pipe | 10 |
cat f \ l2u \ grep PRINT |
outputs all uppercase | 2 pipes | 20 |
cat < f \ cat \ grep print > out; cat out |
3 PIPEs | out file created with contents | 10 |
cp f g; ls |
show f and g SAME size | Test their cp | 10 |
-
Introduction to Operating Systems: Unix/Linux, MTX. computer system and operations, system development software, PC emulators, link C and assembly programs.
-
Booting OS
-
ARM Archicture, ARM programming and embedded systems
-
Processes: Concept and implementation of processes; process states, context switching, process scheduling.
-
Process management: fork, wait, exit, exec, signals, pipes in Unix/Linux and Wanix. Processes in (microKernel based) OS: Micro vs. Monnolithic Kernels, tasks, servers and user processes in Minix;
-
Process Synchronization:
The process model; mutual exclusion and critical regions, Implementation of low-level mutual exclusion primitives. Synchronization primitives; events, event queues, semaphores. -
Process Communication:
High-level process synchronization constructs; messages. -
Process Control:
Scheduling algorithms. Dead lock and starvation problems. -
Memory Management: Memory management schemes
Paging and Virtual memory -
I/O device drivers:
Interrupts and interrupt processing Interraction between interrupt handler and process. Design and implementation of I/O drivers; -
File Systems: Review of EXT2 file system. NFS and RFS based on UDP and TCP/IP
-
Real-time OS