vbr work, also problems to copy a file over 4096 bytes
This commit is contained in:
1 parent
23c2fbe1ec
commit
3f4d8afe6e
6 files changed
+45
-4
No files matched your search
+19
-1
@@ -193,6 +193,19 @@ int main (int argc, char *argv[])
|
||||
// Parse parameters for cmd usage
|
||||
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':
|
||||
{
|
||||
// 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.
|
||||
// First check if we should create a new disk
|
||||
if (settings->new_diskname != NULL)
|
||||
@@ -273,7 +291,7 @@ int main (int argc, char *argv[])
|
||||
{
|
||||
lsfs_disk_install_bootloader(settings->install_bootloader_path);
|
||||
}
|
||||
sleep(1);
|
||||
|
||||
if (settings->install_vbr_path != NULL)
|
||||
{
|
||||
lsfs_disk_install_vbr(settings->install_vbr_path);
|
||||
|
||||
+1
-1
Submodule lsfs_vbr/lsfs_16-bit updated: 73498055ec...0a6c743d81.
@@ -1,7 +1,7 @@
|
||||
ORG 0x7c00
|
||||
BITS 16
|
||||
%define DISK_SERVICE 0x0050:0x0000
|
||||
%define KERNEL 0x2500:0x0000 ;0x0050:0x0512
|
||||
%define KERNEL 0x0150:0x0000 ;0x0050:0x0512
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; Volume Boot Record
|
||||
; This will start SingOS from the disk
|
||||
@@ -120,8 +120,15 @@ ext_disk_supported:
|
||||
mov dl, [global_disk_identifier]
|
||||
int 0x13
|
||||
|
||||
|
||||
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 cx, Parameter_Struct
|
||||
mov ax, 0x1
|
||||
push cx
|
||||
push bx
|
||||
@@ -161,7 +168,7 @@ ext_disk_supported:
|
||||
; Set the Parameter_Struct
|
||||
mov ax, kernel_path
|
||||
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_size], 0xFFFF
|
||||
mov WORD [Parameter_Struct.byte_offset_into_file], 0x00
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
nasm -fbin test_kernel.nasm -o kernel.bin
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user