Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ disk:

run: iso disk
@if [ -n "$$DISPLAY" ] || [ -n "$$WAYLAND_DISPLAY" ]; then \
qemu-system-i386 -cdrom $(ISO) -drive file=$(DATA_DISK),format=raw,if=ide,index=0,media=disk; \
qemu-system-i386 -cdrom $(ISO) -drive file=$(DATA_DISK),format=raw,if=ide,index=0,media=disk -m 512M; \
else \
echo "No GUI display detected, falling back to nographic mode."; \
qemu-system-i386 -cdrom $(ISO) -drive file=$(DATA_DISK),format=raw,if=ide,index=0,media=disk -nographic -serial mon:stdio; \
qemu-system-i386 -cdrom $(ISO) -drive file=$(DATA_DISK),format=raw,if=ide,index=0,media=disk -nographic -serial mon:stdio -m 512M; \
fi

run-nographic: iso disk
qemu-system-i386 -cdrom $(ISO) -drive file=$(DATA_DISK),format=raw,if=ide,index=0,media=disk -nographic -serial mon:stdio
qemu-system-i386 -cdrom $(ISO) -drive file=$(DATA_DISK),format=raw,if=ide,index=0,media=disk -nographic -serial mon:stdio -m 512M

clean:
rm -rf build
Expand Down
5 changes: 5 additions & 0 deletions src/ata.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ int ata_write_sector(uint32_t lba, const void *buffer) {
return ata_wait_not_busy();
}

int ata_zero_sector(uint32_t lba) {
uint8_t sector[512] = {0};
return ata_write_sector(lba, sector);
}

uint32_t ata_get_sector_count() {
uint16_t buf[256];
ata_wait_not_busy();
Expand Down
Loading