|
@ -19,9 +19,10 @@ |
|
|
|
|
|
|
|
|
void dump_ax(input); |
|
|
void dump_ax(input); |
|
|
void print_stack(argument); |
|
|
void print_stack(argument); |
|
|
|
|
|
void print_newline(); |
|
|
|
|
|
|
|
|
typedef struct Directory_Table Directory_Table; |
|
|
typedef struct Directory_Table Directory_Table; |
|
|
typedef struct struct_table_entry struct_table_entry; |
|
|
typedef struct Struct_Table_Entry Table_Entry; |
|
|
typedef struct struct_partition_control partition_control; |
|
|
typedef struct struct_partition_control partition_control; |
|
|
typedef struct File_System_Control_Information FSCI; |
|
|
typedef struct File_System_Control_Information FSCI; |
|
|
typedef struct meta_information_format mif; |
|
|
typedef struct meta_information_format mif; |
|
@ -36,9 +37,34 @@ typedef enum Table_Entry_Kind |
|
|
ENTRY_DIRECTORY = 2, |
|
|
ENTRY_DIRECTORY = 2, |
|
|
} Table_Entry_Kind; |
|
|
} Table_Entry_Kind; |
|
|
|
|
|
|
|
|
|
|
|
typedef enum Service_Action |
|
|
|
|
|
{ |
|
|
|
|
|
SERIVCE_LOAD_DISK = 1, |
|
|
|
|
|
SERVICE_FIND_ENTRY = 2, |
|
|
|
|
|
SERIVCE_READ_DATA = 3, |
|
|
|
|
|
SERIVCE_WRITE_DATA = 4, |
|
|
|
|
|
|
|
|
|
|
|
} Service_Action; |
|
|
|
|
|
|
|
|
int number_low; |
|
|
int number_low; |
|
|
int selector; |
|
|
int selector; |
|
|
|
|
|
|
|
|
|
|
|
struct Struct_Table_Entry |
|
|
|
|
|
{ |
|
|
|
|
|
char filename[256]; |
|
|
|
|
|
long file_id[2]; |
|
|
|
|
|
long file_size[2]; |
|
|
|
|
|
void* ext_file_data_low; |
|
|
|
|
|
void* ext_file_data_high; |
|
|
|
|
|
long number_sector_s; // <- Just try to remove the last undercore and compile .
|
|
|
|
|
|
short entry_kind; |
|
|
|
|
|
short extra_control_bits1; |
|
|
|
|
|
short extra_control_bits2; |
|
|
|
|
|
short extra_control_bits3; |
|
|
|
|
|
long table_entry_sector_index[2]; |
|
|
|
|
|
long data_pointer[NUM_DATA_POINTERS * 2]; // if it is a directory, the first pointer will be to the next table.
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
struct File_System_Control_Information |
|
|
struct File_System_Control_Information |
|
|
{ |
|
|
{ |
|
|
char filesystem_information[256]; |
|
|
char filesystem_information[256]; |
|
@ -54,69 +80,89 @@ struct File_System_Control_Information |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
struct test |
|
|
typedef struct Directory_Table |
|
|
{ |
|
|
{ |
|
|
char* first; |
|
|
Table_Entry entries[DEFAULT_TABLE_SIZE]; |
|
|
char* second; |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
int argument; |
|
|
|
|
|
void print(argument); |
|
|
|
|
|
|
|
|
|
|
|
int main(selector, path, path_segment, fsci_lba_index) |
|
|
void print(string); |
|
|
int path_segment; |
|
|
|
|
|
int fsci_lba_index; |
|
|
int main(selector, parameter_struct) |
|
|
char path[256]; |
|
|
int selector; |
|
|
|
|
|
void* parameter_struct; |
|
|
{ |
|
|
{ |
|
|
// selectot should be a "selector" for which disk service
|
|
|
// selectot should be a "selector" for which disk service
|
|
|
// one wnats to use.
|
|
|
// one wnats to use.
|
|
|
// 0 should not be used, to try to ensure that a value has been set explicitly.
|
|
|
// 0 should not be used, to try to ensure that a value has been set explicitly.
|
|
|
|
|
|
FSCI fsci; |
|
|
|
|
|
Service_Action service_action; |
|
|
|
|
|
Directory_Table current_table; |
|
|
int local_segment = 0x7e0; |
|
|
int local_segment = 0x7e0; |
|
|
char* local_path = "Hello world\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; |
|
|
int stack_segment = 0x8fc0; |
|
|
struct test my_struct; |
|
|
long index_as_long; |
|
|
char *fs_info; |
|
|
|
|
|
char *hello = "LessSimpleFileSystem_Hello"; |
|
|
|
|
|
char *yes = "Read file: "; |
|
|
|
|
|
int nubmer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
my_struct.first = hello; |
|
|
char local_path[256]; //= "Hello world\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
|
|
|
my_struct.second = yes; |
|
|
service_action = selector; |
|
|
|
|
|
|
|
|
if (selector == 1) |
|
|
switch (service_action) |
|
|
{ |
|
|
{ |
|
|
// SERVICE: READ FILE
|
|
|
case SERIVCE_LOAD_DISK: |
|
|
FSCI fsci; |
|
|
{ |
|
|
print(my_struct.first); |
|
|
/*
|
|
|
print(my_struct.second); |
|
|
What do we need to know: |
|
|
//strcpy(local_path, local_segment, path, path_segment);
|
|
|
Index of FSCI |
|
|
print(local_path); |
|
|
*/ |
|
|
fsci.master_table_index[0] = 42; |
|
|
index_as_long = parameter_struct; |
|
|
nubmer = 0x55; |
|
|
disk_service_read_data_from_disk(index_as_long, 1, &fsci, stack_segment); |
|
|
//dump_ax(fsci.master_table_index[0]);
|
|
|
print("File System has been loaded: "); |
|
|
//dump_ax(nubmer);
|
|
|
print_newline(); |
|
|
//fsci_lba_index = 0x1000;
|
|
|
|
|
|
fsci.filesystem_information[0] = 'i'; |
|
|
|
|
|
fsci.filesystem_information[1] = '\0'; |
|
|
|
|
|
dump_ax(fsci_lba_index); |
|
|
|
|
|
stub(fsci_lba_index, 1, &fsci, 0x8fc0); |
|
|
|
|
|
//fs_info = fsci.filesystem_information;
|
|
|
|
|
|
//dump_ax(&fsci);
|
|
|
|
|
|
print_stack(fsci.filesystem_information); |
|
|
print_stack(fsci.filesystem_information); |
|
|
dump_ax(fsci.master_table_index[0]); |
|
|
print_newline(); |
|
|
} |
|
|
} break; |
|
|
else |
|
|
case SERVICE_FIND_ENTRY: |
|
|
{ |
|
|
{ |
|
|
print(my_struct.first); |
|
|
disk_service_read_data_from_disk(fsci.master_table_index[0], DEFAULT_TABLE_SIZE, ¤t_table, stack_segment); |
|
|
return 0; |
|
|
print("Current table: "); |
|
|
|
|
|
print_newline(); |
|
|
|
|
|
print_stack(current_table.entries[0].filename); |
|
|
|
|
|
print_newline(); |
|
|
|
|
|
print_stack(current_table.entries[1].filename); |
|
|
|
|
|
print_newline(); |
|
|
|
|
|
print_stack(current_table.entries[2].filename); |
|
|
|
|
|
print_newline(); |
|
|
|
|
|
} break; |
|
|
|
|
|
case SERIVCE_READ_DATA: |
|
|
|
|
|
{ |
|
|
|
|
|
/*
|
|
|
|
|
|
What do we need to know: |
|
|
|
|
|
path |
|
|
|
|
|
// Buffer:
|
|
|
|
|
|
destination_segment |
|
|
|
|
|
destination_address |
|
|
|
|
|
*/ |
|
|
|
|
|
print("Hit READ case"); |
|
|
|
|
|
} break; |
|
|
|
|
|
case SERIVCE_WRITE_DATA: |
|
|
|
|
|
{ |
|
|
|
|
|
print("Hit WRITE case"); |
|
|
|
|
|
} break; |
|
|
|
|
|
default: |
|
|
|
|
|
{ |
|
|
|
|
|
print("Default case"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void print(argument) |
|
|
//void load_
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void print(string) |
|
|
|
|
|
char* string; |
|
|
{ |
|
|
{ |
|
|
#asm |
|
|
#asm |
|
|
push bp |
|
|
push bp |
|
@ -164,3 +210,16 @@ void* input; |
|
|
pop bp |
|
|
pop bp |
|
|
#endasm |
|
|
#endasm |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void print_newline() |
|
|
|
|
|
{ |
|
|
|
|
|
#asm |
|
|
|
|
|
printCRLF: |
|
|
|
|
|
mov ah, #0xE |
|
|
|
|
|
mov al, #13 |
|
|
|
|
|
int #0x10 |
|
|
|
|
|
mov al, #10 |
|
|
|
|
|
int #0x10 |
|
|
|
|
|
ret |
|
|
|
|
|
#endasm |
|
|
|
|
|
} |