Operating Systems, Quiz 1
If the memory map for a device starts from the offset 0x40005000 and has a size of 1024 bytes in a 32-bit addressing scheme, what will be the last address in the memory map?
If the memory map for a device starts from the offset 0x40005000 and has a size of 1024 bytes in a 32-bit addressing scheme, what will be the last address in the memory map? Consider the following code snippet: #define TIMER_BASE 0x40010000 void configure_timer(){ uint32_t *config_reg = (uint32_t*)(TIMER_BASE + 0x00); uint8_t *status_reg = (uint8_t*)(TIMER_BASE + 0x04); uint16_t *counter_reg = (uint16_t*)(TIMER_BASE + 0x08); *config_reg = 0x1; while((*status_reg & 0x1) == 0); *counter_reg = 0xFFFF; } What are the sizes of the `config_reg`, `status_reg`, and `counter_reg` registers, respectively? What does the following ‘xv6‘ code snippet accomplish? int pid; pid = fork(); if (pid == 0) { execlp("ls", "ls", "-l", NULL); exit(0); } else if (pid > 0) { int status; wait(&status); }