Answers To Lab 1
The following correct answers are taken from team submissions
E2
mov ax, 0x0402 eax = 0x65 esp = 0xffb6 0x0000ffb4 = 0x00650000 after exec: eax = 0x402 esp = 0xffb6 0x0000ffb4 = 0x00650000
E3
t=9 takes the value in al, which is 1111 or 15, and sends it to port 70, the CMOS RTC.
E4
part a
0x00007c2d is the first 32-bit address
part b
The last instruction the bootloader executes is 7d87 which is call *%eax. The first instruction of the kernal is 0x0010000c, mov work ptr ds:0x472, 0x1234.
part c
c.The bootloader gets the number of kernel sectors from the ELF header (eph = ph + ELFHDR->e_phnum;)
E10
first it nukes the frame pointer by setting it to zero. Then sets the stack pointer to the top of the bootstack. According to nmu.h and memlayout.h, the initial kernal stack size is KSTKSIZE = 8*PGSIZE. page size is 4096 bytes which makes the stack size 32768.
E11
each recursive nesting level pushes 8 32 bit words onto the stack.