=== This template file contains questions you need to answer. === Fill your answers on appropriate blank lines only. === Don't start any line with three equal signs "===". === Don't edit any lines starting from three equal signs. === Use C notation to write numbers: 42 for decimal, 0x2a for hexadecimal. === We may check most of the answers automatically, so "forty two" or === "26+16" won't work for this example. Spaces are mostly ignored, so === " 42 " is OK (without quotes of course). === When asked to specify address & instruction, do it in the form of === gdb output "ADDRESS: INSTRUCTION", for example "0x7c26: or $0x1,%eax" === Don't make lines longer than 80 characters. You don't need to fit your === answer in a single line, you can start a new line at will. === Q What is the number of the first port BIOS writes into? === Q What is the number of the first port BIOS reads from? === Q What device is probably accessed through above ports? === Q What instruction causes processor to switch to 32-bit mode? === (specify address & instruction) === Q What's the instruction performed immediately after the processor === is switched to 32-bit mode? (address & instruction) === Q What is the last instruction of boot loader? (address & instruction) === Q What is first instruction of the kernel? (address & instruction) === Q Where boot loader finds information how many sectors it must === read in order to fetch the entire kernel from disk? === (remove leading "====" from the correct answer line) ==== hard coded in boot loader ==== elf header ==== elf tail ==== gnome header ==== gnome tail ==== none of above === Q Where boot loader finds information what address to start === executing kernel from? === (remove leading "====" from the correct answer line) ==== hard coded in boot loader ==== elf header ==== elf tail ==== gnome header ==== gnome tail ==== none of above === Q What C function in boot loader contains the logic of reading the === whole kernel? (not full function declaration, just the name) === Q What are 4 words of memory at 0x100000 at the point the BIOS === enters the boot loader? === (as displayed by gdb, in the form WORD1 WORD2 WORD3 WORD4) === Q What are 4 words of memory at 0x100000 at the point the boot === loader enters the kernel? === (as displayed by gdb, in the form WORD1 WORD2 WORD3 WORD4) === Q What's the link address of .text section of the kernel? === Q What's the entry point (start address) of the kernel? === Q What source file contains the first kernel instruction? === (file name including extensions, but excluding the path) === Q Study the file you've just found. === What's the name of a kernel entry point as appears in this file? === Q What line among all kernel sources declares the name you've just === found as kernel entry point? (full line) === Q What's the first instruction which would "break" if you were to === get the boot loader's link address wrong? "Break" here means: === the result of executing the instruction is different from the === one before the change of the link address. === Check yourself by recompiling & debugging! === (address & instruction) === Q What's the first instruction after the kernel establishes a new === mapping that would fail to work properly if the mappings were === not in place? (address & instruction) === Q What functions from console.c are directly used by printf.c? === (just function names separated by spaces, not full declarations) === Q What is the task of console.c lines 194-202? === (free form, up to 10 words) === Consider the code === int x = 1, y = 3, z = 4; === cprintf("x %d, y %x, z %d\n", x, y, z); === executing inside cprintf function just after fmt and ap are === initialized (just before the call to vcprintf). === Q What's the contents of the first byte in memory pointed to by === fmt? (write this byte as a number) === Q What's the contents of the first byte in memory pointed to by === ap? (write this byte as a number) === Consider the code === unsigned int i = 0x00646c72; === cprintf("H%x Wo%s", 57616, &i); === Q What is the output of the code? === Q To lead to the same output in big-endian architecture, what === should be the value of the second argument? === Q To lead to the same output in big-endian architecture, what === should be the value of i? === Q What is printed after "y=" for cprintf("x=%d y=%d", 3)? === (free form, up to 10 words) === Q What instruction reserves space for kernel stack? === (address & instruction) === Q How many 32-bit words (i.e. bytes/4) does each recursive nesting === level of test_backtrace adds to the stack size?