Fix wrong serial selection in qemu. Simplify code.

pull/15/head
Andre Richter 5 years ago
parent c21c46b362
commit c6e12f7bcf
No known key found for this signature in database
GPG Key ID: 2116C1AB102F615E

@ -45,7 +45,7 @@ kernel8.img: target/$(TARGET)/release/kernel8
$(OBJCOPY) $(OBJCOPY_PARAMS) $< kernel8.img
qemu: all
$(DOCKER_CMD) $(UTILS_CONTAINER) $(QEMU_CMD) -serial stdio
$(DOCKER_CMD) $(UTILS_CONTAINER) $(QEMU_CMD) -serial null -serial stdio
clippy:
cargo xclippy --target=$(TARGET)

Binary file not shown.

Binary file not shown.

@ -62,20 +62,16 @@ fn kernel_entry() -> ! {
compiler_fence(Ordering::Release);
// send the message to the GPU and receive answer
let serial_avail = match mbox.call(mbox::channel::PROP) {
Err(_) => false,
Ok(()) => true,
match mbox.call(mbox::channel::PROP) {
Err(_) => uart.puts("[i] Unable to query serial!\n"),
Ok(()) => {
uart.puts("[i] My serial number is: 0x");
uart.hex(mbox.buffer[6]);
uart.hex(mbox.buffer[5]);
uart.puts("\n");
}
};
if serial_avail {
uart.puts("[i] My serial number is: 0x");
uart.hex(mbox.buffer[6]);
uart.hex(mbox.buffer[5]);
uart.puts("\n");
} else {
uart.puts("[i] Unable to query serial!\n");
}
// echo everything back
loop {
uart.send(uart.getc());

Loading…
Cancel
Save