diff --git a/src/sys/boot/bootsec.asm b/src/sys/boot/bootsec.asm index 1cd8042..4fa1b66 100755 --- a/src/sys/boot/bootsec.asm +++ b/src/sys/boot/bootsec.asm @@ -75,11 +75,17 @@ mov al,0x0c out dx,al ;lets convert the ELF file to a linear binary so we can execute it - cmp dword [0x600],464c457fh ; The ELF signature is \07fELF +;mji cmp dword [0x600],464c457fh ; The ELF signature is \07fELF +;mjikaboom + cmp dword [0x0a0000],464c457fh ; The ELF signature is \07fELF jne ldr_ELF_err ; Ugh... not an ELF file !!! - cmp word [0x600+4],101h ; It should be statically linked etc. +;mji cmp word [0x600+4],101h ; It should be statically linked etc. +;mjikaboom + cmp word [0x0a0000+4],101h ; It should be statically linked etc. jne ldr_ELF_err - cmp byte [0x600+6],1 +;mji cmp byte [0x600+6],1 +;mjikaboom + cmp byte [0x0a0000+6],1 jne ldr_ELF_err jmp short skip_err_handler ldr_ELF_err: @@ -94,17 +100,23 @@ hlt skip_err_handler: - mov eax, [0x600+18h] +;mji mov eax, [0x600+18h] +;mjikaboom + mov eax, [0x0a0000+18h] mov [krnl_entry], eax xor ecx,ecx ; Get the number of sections in cx - mov cx,[0x600+2ch] +;mji mov cx,[0x600+2ch] +;mjikaboom + mov cx,[0x0a0000+2ch] sectionloop: dec ecx ; Next section push ecx ; Save cx on the stack while we load ; the section into memory - mov bx, 0x600 ; access image location +;mji mov bx, 0x600 ; access image location +;mjikaboom + mov bx, 0x0a0000 ; access image location mov ax,[bx+2ah] ; Get the program header entry size mul cx ; Calculate the offset from the start @@ -123,7 +135,9 @@ mov dword eax,[bx+14h] ; eax <= the size of the section mov dword ebx,[bx+4h] ; Get the offset of the segment in ; the ELF file - add ebx, 0x600 ; +;mji add ebx, 0x600 ; +;mjikaboom + add ebx, 0x0a0000 ; ; set up for memcopy