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:
2021-03-21 17:34:38 +01:00
parent 513693189e
commit 20ab9e1d6e
28 changed files with 351 additions and 121 deletions

View File

@@ -2,15 +2,15 @@
// Created by rick on 06-02-21.
//
#include <attributes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <myke/libk/libk.h>
#include <myke/tasks/task.h>
#include <myke/tasks/locking.h>
#include <myke/attributes.h>
#include <myke/fs/blockdev.h>
#include <myke/libk/libk.h>
#include <myke/tasks/locking.h>
#include <myke/tasks/task.h>
#define MAX_BLOCK_DEVS 64
@@ -122,7 +122,7 @@ void block_dev_scan() {
}
}
void noreturn block_dev_task(void *data) {
void att_noreturn block_dev_task(void *data) {
while (true) {
semaphore_wait(block_semaphore);
block_dev_scan();

View File

@@ -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) {

View File

@@ -2,15 +2,15 @@
// Created by rick on 06-02-21.
//
#include <attributes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <myke/fs/mbr.h>
#include <myke/drivers/pci/ide.h>
#include <myke/fs/blockdev.h>
#include <myke/attributes.h>
#include <myke/fs/mbr.h>
typedef struct {
uint8_t bootable;
@@ -23,14 +23,14 @@ typedef struct {
uint16_t ending_cylinder: 10;
uint32_t start_lba;
uint32_t num_lbas;
} packed mbr_partition_table_entry;
} att_packed mbr_partition_table_entry;
typedef struct {
uint32_t unique_id;
uint16_t reserved;
mbr_partition_table_entry entries[4];
uint8_t signature[2];
} packed mbr_table;
} att_packed mbr_table;
typedef struct {
const block_device_t *device;
@@ -52,7 +52,7 @@ mbr_block_dev_access(const block_device_t *device, uint8_t direction, uint32_t l
return info->device->access(info->device, direction, actual_lba, sectors, target);
}
uint8_t used mbr_check_device(const block_device_t *device, uint8_t *first_sector) {
uint8_t att_used mbr_check_device(const block_device_t *device, uint8_t *first_sector) {
mbr_table table;
memcpy((uint8_t *) &table, first_sector + (device->block_size - sizeof(mbr_table)), sizeof(mbr_table));
if (table.signature[0] != 0x55 && table.signature[1] != 0xAA) { // AA 55 but in little endian

View File

@@ -1,12 +1,13 @@
//
// Created by rick on 11-03-21.
//
#include <attributes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <myke/fs/blockdev.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
typedef struct {
char filename[100];
@@ -25,7 +26,7 @@ typedef struct {
uint64_t device_major;
uint64_t device_minor;
char prefix[155];
} packed ustar_sector;
} att_packed ustar_sector;
typedef struct {
ustar_sector sector;