Procházet zdrojové kódy

vbr work, also problems to copy a file over 4096 bytes

master
Jørn Guldberg před 3 roky
rodič
revize
3f4d8afe6e
6 změnil soubory, kde provedl 45 přidání a 4 odebrání
  1. +19
    -1
      disk_manager_utility.c
  2. +1
    -1
      lsfs_vbr/lsfs_16-bit
  3. +9
    -2
      lsfs_vbr/vbr_lsfs.nasm
  4. +1
    -0
      test/build.sh
  5. +9
    -0
      test/test_kernel.nasm
  6. +6
    -0
      update_vbr.sh

+ 19
- 1
disk_manager_utility.c Zobrazit soubor

@ -193,6 +193,19 @@ int main (int argc, char *argv[])
// Parse parameters for cmd usage // Parse parameters for cmd usage
switch(argv[i][1]) switch(argv[i][1])
{ {
case 'd':
{
// Load disk with specified name
i++; // Go to next parameter which is the path/filename for the new disk
if (i > argc)
{
// Go to loop condition to exit
continue;
}
settings->load_diskname = argv[i];
} break;
case 'n': case 'n':
{ {
// Create new disk // Create new disk
@ -247,6 +260,11 @@ int main (int argc, char *argv[])
} }
} }
if (settings->new_diskname != NULL && settings->load_diskname != NULL)
{
printf("-d and -n cannot be specified in the same qeury\n");
return 1;
}
// Now execute the commands. // Now execute the commands.
// First check if we should create a new disk // First check if we should create a new disk
if (settings->new_diskname != NULL) if (settings->new_diskname != NULL)
@ -273,7 +291,7 @@ int main (int argc, char *argv[])
{ {
lsfs_disk_install_bootloader(settings->install_bootloader_path); lsfs_disk_install_bootloader(settings->install_bootloader_path);
} }
sleep(1);
if (settings->install_vbr_path != NULL) if (settings->install_vbr_path != NULL)
{ {
lsfs_disk_install_vbr(settings->install_vbr_path); lsfs_disk_install_vbr(settings->install_vbr_path);

+ 1
- 1
lsfs_vbr/lsfs_16-bit

@ -1 +1 @@
Subproject commit 73498055ec46bfa2290684b3a2129aebf1ee4f4a
Subproject commit 0a6c743d81cbd871eb40085ecae821965171fd38

+ 9
- 2
lsfs_vbr/vbr_lsfs.nasm Zobrazit soubor

@ -1,7 +1,7 @@
ORG 0x7c00 ORG 0x7c00
BITS 16 BITS 16
%define DISK_SERVICE 0x0050:0x0000 %define DISK_SERVICE 0x0050:0x0000
%define KERNEL 0x2500:0x0000 ;0x0050:0x0512
%define KERNEL 0x0150:0x0000 ;0x0050:0x0512
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Volume Boot Record ; Volume Boot Record
; This will start SingOS from the disk ; This will start SingOS from the disk
@ -120,8 +120,15 @@ ext_disk_supported:
mov dl, [global_disk_identifier] mov dl, [global_disk_identifier]
int 0x13 int 0x13
mov cx, [vbr_LBA_FSCI] mov cx, [vbr_LBA_FSCI]
mov WORD [Parameter_Struct.buffer_segment], 0x7e0
mov WORD [Parameter_Struct.buffer_address], 0x2200 ; Heap memory start adresses for the file system
mov WORD [Parameter_Struct.buffer_size], 0xFFFF ; End address for the heap
mov WORD [Parameter_Struct.data_length], cx
mov bx, ds mov bx, ds
mov cx, Parameter_Struct
mov ax, 0x1 mov ax, 0x1
push cx push cx
push bx push bx
@ -161,7 +168,7 @@ ext_disk_supported:
; Set the Parameter_Struct ; Set the Parameter_Struct
mov ax, kernel_path mov ax, kernel_path
mov [Parameter_Struct.path], ax mov [Parameter_Struct.path], ax
mov WORD [Parameter_Struct.buffer_segment], 0x2500
mov WORD [Parameter_Struct.buffer_segment], 0x0150
mov WORD [Parameter_Struct.buffer_address], 0x00 mov WORD [Parameter_Struct.buffer_address], 0x00
mov WORD [Parameter_Struct.buffer_size], 0xFFFF mov WORD [Parameter_Struct.buffer_size], 0xFFFF
mov WORD [Parameter_Struct.byte_offset_into_file], 0x00 mov WORD [Parameter_Struct.byte_offset_into_file], 0x00

+ 1
- 0
test/build.sh Zobrazit soubor

@ -0,0 +1 @@
nasm -fbin test_kernel.nasm -o kernel.bin

+ 9
- 0
test/test_kernel.nasm Zobrazit soubor

@ -0,0 +1,9 @@
BITS 16
; ready to jump to the kernel
xor bx, bx
mov al, 0x49
mov ah, 0x0E
int 0x10
cli
hlt

+ 6
- 0
update_vbr.sh Zobrazit soubor

@ -0,0 +1,6 @@
set -e
cd lsfs_vbr/
bash build.sh
cd ..
./disk_manager -d test.img -v lsfs_vbr/vbr.bin
qemu-system-x86_64 test.img

Načítá se…
Zrušit
Uložit