feat: gdt, attributes move, reorder
Added late gdt setup with initial tss Moved attributes to include root Reordered some imports
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
// Created by rick on 07-02-21.
|
||||
//
|
||||
|
||||
#include <attributes.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <myke/fs/blockdev.h>
|
||||
#include <sys/types.h>
|
||||
#include <myke/attributes.h>
|
||||
|
||||
#define FAT_TYPE_12 1
|
||||
#define FAT_TYPE_16 2
|
||||
@@ -31,7 +31,7 @@ typedef struct {
|
||||
uint16_t heads_sides;
|
||||
uint32_t hidden_sectors;
|
||||
uint32_t large_total_sectors;
|
||||
} packed bpb;
|
||||
} att_packed bpb;
|
||||
union {
|
||||
struct {
|
||||
uint8_t drive_number;
|
||||
@@ -40,7 +40,7 @@ typedef struct {
|
||||
uint32_t serial;
|
||||
uint8_t label[11];
|
||||
uint8_t system_id[8];
|
||||
} packed ebr_12_16;
|
||||
} att_packed ebr_12_16;
|
||||
struct {
|
||||
uint32_t sectors_per_fat;
|
||||
uint16_t flags;
|
||||
@@ -55,21 +55,21 @@ typedef struct {
|
||||
uint32_t serial;
|
||||
uint8_t label[11];
|
||||
uint8_t system_id[8];
|
||||
} packed ebr_32;
|
||||
} att_packed ebr_32;
|
||||
};
|
||||
} packed fat_bpb;
|
||||
} att_packed fat_bpb;
|
||||
|
||||
typedef struct {
|
||||
uint8_t hours: 5;
|
||||
uint8_t minutes: 6;
|
||||
uint8_t seconds: 5;
|
||||
} packed time_83;
|
||||
} att_packed time_83;
|
||||
|
||||
typedef struct {
|
||||
uint8_t hours: 5;
|
||||
uint8_t minutes: 6;
|
||||
uint8_t seconds: 5;
|
||||
} packed date_83;
|
||||
} att_packed date_83;
|
||||
|
||||
typedef struct {
|
||||
union {
|
||||
@@ -86,7 +86,7 @@ typedef struct {
|
||||
date_83 last_mod_date;
|
||||
uint16_t low_first_cluster;
|
||||
uint32_t file_size;
|
||||
} packed name_83;
|
||||
} att_packed name_83;
|
||||
struct {
|
||||
uint8_t order;
|
||||
uint16_t text_1[5];
|
||||
@@ -96,9 +96,9 @@ typedef struct {
|
||||
uint16_t text_2[6];
|
||||
uint16_t reserved;
|
||||
uint16_t text_3[2];
|
||||
} packed long_name;
|
||||
} att_packed long_name;
|
||||
};
|
||||
} packed fat_directory_entry;
|
||||
} att_packed fat_directory_entry;
|
||||
|
||||
void print_chars(char *chars, int amount) {
|
||||
for (int i = 0; i < amount; ++i) {
|
||||
@@ -107,7 +107,7 @@ void print_chars(char *chars, int amount) {
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t used fat_check_device(const block_device_t *device, uint8_t *first_sector) {
|
||||
uint8_t att_used fat_check_device(const block_device_t *device, uint8_t *first_sector) {
|
||||
fat_bpb bpb;
|
||||
memcpy((uint8_t *) &bpb, first_sector, sizeof(fat_bpb));
|
||||
if (bpb.bpb.sectors_per_fat == 0 || bpb.bpb.sectors_per_cluster == 0) {
|
||||
|
||||
Reference in New Issue
Block a user