virtio_cb(): squelched some compiler warnings
This commit is contained in:
parent
513fb8a813
commit
c9452fd542
3 changed files with 11 additions and 1 deletions
BIN
drive.qcow2
Normal file
BIN
drive.qcow2
Normal file
Binary file not shown.
9
iso.json
Normal file
9
iso.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"iso9660": true,
|
||||
"disksize": 16,
|
||||
"initrd": { "type": "tar", "directory": "build/boot" },
|
||||
"config": "bootparam.cfg",
|
||||
"partitions": [
|
||||
{ "type": "boot", "size": 16 }
|
||||
]
|
||||
}
|
||||
|
|
@ -66,6 +66,7 @@ void _start() {
|
|||
}
|
||||
|
||||
void virtio_cb(struct blk_req req, void *userdata) {
|
||||
(void)userdata;
|
||||
char *type = NULL;
|
||||
switch (req.type) {
|
||||
case BLK_REQ_READ: type = "READ"; break;
|
||||
|
|
@ -77,7 +78,7 @@ void virtio_cb(struct blk_req req, void *userdata) {
|
|||
} else {
|
||||
uint8_t *p = pa_to_pointer(req.data);
|
||||
printlinef("%s done: %u sectors starting at %u", type, req.num_sectors, req.sector);
|
||||
for (int i = 0; i < req.num_sectors; i++) {
|
||||
for (uint64_t i = 0; i < req.num_sectors; i++) {
|
||||
printlinef("sector %u: %X8 %X8 %X8 %X8 ...", req.sector + i,
|
||||
p[512*i], p[512*i + 1], p[512*i + 2], p[512*i + 3]
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue