The Problem: The Raw Machine Provides a Hostile Environment
- Imagine program in machine language.
Machine Language Program for Mips Machine
[0x00400000] 0x8fa40000 lw $4, 0($29) ; lw $a0, 0($sp)
[0x00400004] 0x27a50004 addiu $5, $29, 4 ; addiu $a1, $sp, 4 # argv
[0x00400008] 0x24a60004 addiu $6, $5, 4 ; addiu $a2, $a1, 4 # envp
[0x0040000c] 0x00041080 sll $2, $4, 2 ; sll $v0, $a0, 2
[0x00400010] 0x00c23021 addu $6, $6, $2 ; addu $a2, $a2, $v0
[0x00400014] 0x0c000000 jal 0x00400020 [main] ; jal main
[0x00400018] 0x3402000a ori $2, $0, 10 ; li $v0 10
[0x0040001c] 0x0000000c syscall ; syscall
[0x00400020] 0x34010028 ori $1, $0, 40 ; subu $sp, 40
- Imagine doing disk I/O directly:
- disk description
- controlling Heads; timing
- keeping track of where things are stored
- dealing with Errors
- Other I/O
- Keeping track of memory
- Sharing the CPU