Question 1
Consider the code segment (for xv6) given below.
1 #define UART_BASE 0xA0004000 2 void init_uart(){ 3 u16 *baud_reg = (u16*)UART_BASE; 4 *baud_reg = 0x7D; 5 } 6 u32 read_uart(){ 7 u32 *rx_reg = (u32*)(UART_BASE + 8); 8 u8 *status_reg = (u8*)(UART_BASE + 12); 9 while((*status_reg & 0x4) == 0);10 return *rx_reg;11 }What is the base address and the end address of the RX register?
The base address is 0xA0004008, and end address is 0xA000400B.
The base address is 0xA0004008, and end address is 0xA000400C.
The base address is 0xA0004008, and end address is 0xA0004012.
The base address is 0xA0004000, and end address is 0xA0004004.
