aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/fs')
-rw-r--r--src/kernel/fs/atapi_pio.c3
-rw-r--r--src/kernel/fs/atapi_pio.h6
-rw-r--r--src/kernel/fs/install.c12
3 files changed, 17 insertions, 4 deletions
diff --git a/src/kernel/fs/atapi_pio.c b/src/kernel/fs/atapi_pio.c
index 34cd1e6..c2cdd8c 100644
--- a/src/kernel/fs/atapi_pio.c
+++ b/src/kernel/fs/atapi_pio.c
@@ -27,6 +27,7 @@ void ATAPI_granular_read(uint32_t nblocks, uint32_t lba, uint8_t *output)
{
for (uint32_t i = 0; i < nblocks; i++) {
ATAPI_read(1, lba + i);
- for (uint16_t j = 0; j < ATAPI_SECTOR_SIZE; j++) output[j + (2048 * i)] = ((uint8_t *) ATAPI_PIO_BUFFER)[j];
+ for (uint16_t j = 0; j < ATAPI_SECTOR_SIZE; j++)
+ output[j + (2048 * i)] = ((uint8_t *) ATAPI_PIO_BUFFER)[j];
}
} \ No newline at end of file
diff --git a/src/kernel/fs/atapi_pio.h b/src/kernel/fs/atapi_pio.h
index be48f2f..20bef43 100644
--- a/src/kernel/fs/atapi_pio.h
+++ b/src/kernel/fs/atapi_pio.h
@@ -5,9 +5,9 @@
#define ATAPI_PIO_DRIVE 0xE0
#define LBA_READ_INT 0x13
-#define ATAPI_PIO_DAPACK 0x7E00
-#define ATAPI_PIO_BUFFER 0x8000
-#define ATAPI_SECTOR_SIZE 0x800
+#define ATAPI_PIO_DAPACK 32256
+#define ATAPI_PIO_BUFFER 32768
+#define ATAPI_SECTOR_SIZE 2048
struct dapack {
uint8_t size;
diff --git a/src/kernel/fs/install.c b/src/kernel/fs/install.c
index d5f62b2..386ca0a 100644
--- a/src/kernel/fs/install.c
+++ b/src/kernel/fs/install.c
@@ -61,6 +61,18 @@ void install_melvix()
kfree(kernel);
kfree(kernel_e);
+ info("Copying font... ");
+ char* font_p[] = {"FONT.BIN"};
+ struct iso9660_entity* font_e = ISO9660_get(font_p, 1);
+ if(!font_e)
+ panic("Font not found!");
+ uint8_t *font = kmalloc(font_e->length + 2048);
+ serial_write_hex(font_e->length + 2048);
+ ATAPI_granular_read(1 + (font_e->length / 2048), font_e->lba, font);
+ marfs_new_file(font_e->length, font, 0, 0, 0);
+ kfree(font);
+ kfree(font_e);
+
info("Installation successful!");
serial_write("Installation successful!\nRebooting...\n");
timer_wait(200);