Question 1
Consider the code segment (for xv6) given below.
1 #define UART_BASE 0xB0005000 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 are the base address and the end address of the RX register?
The base address is 0xB0005008, and end address is 0xB000500C.
The base address is 0xB0005008, and end address is 0xB000500B.
The base address is 0xB0005008, and end address is 0xB0005012.
The base address is 0xB0005000, and end address is 0xB0005004.
