You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 line
3.3 KiB

5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
5 年之前
  1. /* Adress to dump ax, 7C2A*/
  2. /* Address to print 7C47*/
  3. /* */
  4. /* */
  5. #include "main.h"
  6. int main(selector, pointer_parameter_segment, pointer_parameter_struct)
  7. int selector;
  8. void* pointer_parameter_segment;
  9. void* pointer_parameter_struct;
  10. {
  11. /* selectot should be a "selector" for which disk service*/
  12. /* one wnats to use. */
  13. /* 0 should not be used, to try to ensure that a value has been set explicitly. */
  14. FSCI fsci;
  15. Service_Action service_action;
  16. Directory_Table current_table;
  17. Parameter_Struct parameter_struct;
  18. int local_segment = 0x7e0;
  19. unsigned int heap_start = 0x2000;
  20. unsigned int heap_end = 0xffff;
  21. int stack_segment = 0x8fc0;
  22. int path_length;
  23. long index_as_long;
  24. char *local_path = 0;
  25. service_action = selector;
  26. switch (service_action)
  27. {
  28. case SERIVCE_LOAD_DISK:
  29. {
  30. /*
  31. What do we need to know:
  32. Index of FSCI
  33. */
  34. index_as_long = pointer_parameter_struct;
  35. disk_service_read_data_from_disk(index_as_long, 1, &fsci, stack_segment);
  36. print("File System has been loaded: ");
  37. print_newline();
  38. set_heap_settings(heap_start, heap_end);
  39. print_stack(fsci.filesystem_information);
  40. print_newline();
  41. } break;
  42. case SERVICE_FIND_ENTRY:
  43. {
  44. String_Array *path_array;
  45. int i;
  46. memcpy(&parameter_struct, stack_segment, pointer_parameter_struct, pointer_parameter_segment, sizeof(Parameter_Struct));
  47. path_length = strlen(parameter_struct.path, pointer_parameter_segment);
  48. local_path = malloc(256);
  49. memcpy(local_path, local_segment, parameter_struct.path, pointer_parameter_segment, path_length);
  50. local_path[path_length] = 0;
  51. print(local_path);
  52. path_array = string_split_c(local_path, '/', 0);
  53. print_newline();
  54. print_newline();
  55. for (i = 0; i < path_array->length; ++i)
  56. {
  57. print(path_array->strings[i]->chars);
  58. print_newline();
  59. }
  60. print_newline();
  61. print_newline();
  62. print_newline();
  63. disk_service_read_data_from_disk(fsci.master_table_index[0], DEFAULT_TABLE_SIZE, &current_table, stack_segment);
  64. print("Current table: ");
  65. print_newline();
  66. print_stack(current_table.entries[0].filename);
  67. print_newline();
  68. print_stack(current_table.entries[1].filename);
  69. print_newline();
  70. print_stack(current_table.entries[2].filename);
  71. print_newline();
  72. } break;
  73. case SERIVCE_READ_DATA:
  74. {
  75. /*
  76. What do we need to know:
  77. path
  78. Buffer:
  79. destination_segment
  80. destination_address
  81. buffer_size
  82. offset_into_file
  83. */
  84. print("Hit READ case");
  85. } break;
  86. case SERIVCE_WRITE_DATA:
  87. {
  88. print("Hit WRITE case");
  89. } break;
  90. default:
  91. {
  92. print("Default case");
  93. }
  94. }
  95. return 0;
  96. }
  97. /* void load_*/