[victoriafalls] Read some of the ext2 superblock as a POC
This commit is contained in:
parent
29d9923f5a
commit
0274339cc9
|
@ -8,6 +8,7 @@ target_include_directories(victoriafalls
|
||||||
target_link_libraries(victoriafalls
|
target_link_libraries(victoriafalls
|
||||||
glacier
|
glacier
|
||||||
mammoth
|
mammoth
|
||||||
|
yellowstone_stub
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(victoriafalls PROPERTIES
|
set_target_properties(victoriafalls PROPERTIES
|
||||||
|
|
|
@ -1,9 +1,28 @@
|
||||||
#include <mammoth/debug.h>
|
#include <mammoth/debug.h>
|
||||||
#include <mammoth/init.h>
|
#include <mammoth/init.h>
|
||||||
|
#include <yellowstone_stub.h>
|
||||||
|
|
||||||
|
struct Superblock {
|
||||||
|
uint32_t inode_count;
|
||||||
|
uint32_t blocks_count;
|
||||||
|
uint32_t reserved_blocks_count;
|
||||||
|
uint32_t free_blocks_count;
|
||||||
|
uint32_t free_inodes_count;
|
||||||
|
};
|
||||||
|
|
||||||
uint64_t main(uint64_t init_cap) {
|
uint64_t main(uint64_t init_cap) {
|
||||||
ParseInitPort(init_cap);
|
ParseInitPort(init_cap);
|
||||||
|
|
||||||
dbgln("VFs Started");
|
dbgln("VFs Started");
|
||||||
|
|
||||||
|
YellowstoneStub yellowstone(gInitEndpointCap);
|
||||||
|
ASSIGN_OR_RETURN(ScopedDenaliClient denali, yellowstone.GetDenali());
|
||||||
|
|
||||||
|
ASSIGN_OR_RETURN(MappedMemoryRegion region, denali.ReadSectors(2, 2));
|
||||||
|
Superblock* super = reinterpret_cast<Superblock*>(region.vaddr());
|
||||||
|
|
||||||
|
dbgln("Inodes: %x / %x", super->free_inodes_count, super->inode_count);
|
||||||
|
dbgln("Blocks: %x / %x", super->free_blocks_count, super->blocks_count);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,6 +98,7 @@ void YellowstoneServer::ServerThread() {
|
||||||
};
|
};
|
||||||
check(ZReplyPortSend(reply_port_cap, sizeof(resp), &resp, 1,
|
check(ZReplyPortSend(reply_port_cap, sizeof(resp), &resp, 1,
|
||||||
&new_denali));
|
&new_denali));
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
dbgln("Unknown request type: %x", req->type);
|
dbgln("Unknown request type: %x", req->type);
|
||||||
|
|
Loading…
Reference in New Issue