bilsch01
2020-12-15 17:57:50 UTC
I am trying to boot a simple 16-bit real mode OS on a thumb drive. It
boots fine on my older pcs but I can't boot it on my newer pc, which has
EFI BIOS. The pc is ASUS VivoBook F512JA-OH36 and has an SSD with Win10
and Ubuntu installed on it. The EFI BIOS is American Megatrends version
302. I have "secure boot" turned off in the BIOS. I have previously
booted other thumb drives on the newer pc (Knoppix and Ubuntu Live) so I
am familiar with booting from a thumb drive on the newer pc.
The OS I want to boot is on partition #1 of a thumb drive. The system
type indicated in the partition table is FAT16 LBA (0x0e) and the boot
flag is set. The boot sector of partition #1 is definitely not a
standard FAT16 LBA boot sector (see listing at the end of this post). It
simply loads the 16 sector OS from partition #1 to 0:0x1000 and performs
a long jump to the code. The boot sector has the standard 55AA signature
at the end. Partition #1 has a lot of space on it besides the boot
sector and the 16 sector OS - it is 32.5 MB. The OS isn't much of an OS,
but rather aspires to be a text editor which operates on files in
partition #2 and #3 of the thumb drive. Partition #2 and #3 are standard
FAT16 LBA partitions - but they are not bootable.
The boot options listed by the EFI BIOS upon initial start up are:
OPTION #1 UBUNTU WDC PC SN520
OPTION #2 WINDOWS WDC PC SN520
OPTION #3 UEFI: USB DISK PARTITION #2
OPTION #4 UEFI: USB DIDK PARTITION #3
You can select one of the USB DISK PARTITIONS to boot by moving and
saving its line to the OPTION #1 position in the EFI BIOS. If the
selected partition is bootable it will be booted when you exit from the
EFI BIOS. The problem is that the system I want to boot is on USB DISK
PARTITION #1, which isn't even listed. For some reason the BIOS does not
include partition #1 as an option for booting.
QUESTION 1: does anyone know why it might not accept partition #1 as a
boot option?
QUESTION 2: can I avoid the problem if I "enroll" a "hash" of something
to the EFI system? If so, I don't know how to do that.
Below is a listing of partition #1 boot sector. Note: the bytes between
the executable code and the 55AA signature are filled with ASCII 0x6B.
00000000 B80000 mov ax,0x0
00000003 8ED0 mov ss,ax
00000005 BCFF7A mov sp,0x7aff
00000008 8ED8 mov ds,ax
0000000A BE007B mov si,0x7b00
0000000D C7041000 mov word [si],0x10
00000011 C744021000 mov word [si+0x2],0x10
00000016 C744040000 mov word [si+0x4],0x0
0000001B C744060010 mov word [si+0x6],0x1000
00000020 C744086002 mov word [si+0x8],0x260
00000025 C7440A0000 mov word [si+0xa],0x0
0000002A C7440C0000 mov word [si+0xc],0x0
0000002F C7440E0000 mov word [si+0xe],0x0
00000034 B442 mov ah,0x42
00000036 B280 mov dl,0x80
00000038 CD13 int 0x13
0000003A 720A jc 0x46
0000003C B8310E mov ax,0xe31
0000003F CD10 int 0x10
00000041 EA00000010 jmp 0x1000:0x0
00000046 B90200 mov cx,0x2
00000049 C1C004 rol ax,byte 0x4
0000004C 50 push ax
0000004D 240F and al,0xf
0000004F 0430 add al,0x30
00000051 3C39 cmp al,0x39
00000053 7602 jna 0x57
00000055 0407 add al,0x7
00000057 B40E mov ah,0xe
00000059 CD10 int 0x10
0000005B 58 pop ax
0000005C 49 dec cx
0000005D 75EA jnz 0x49
0000005F EBFE jmp short 0x5f
00000061 6B6B6B6B imul bp,[bp+di+0x6b],byte +0x6b
00000065 6B6B6B6B imul bp,[bp+di+0x6b],byte +0x6b
00000069 6B6B6B6B imul bp,[bp+di+0x6b],byte +0x6b
000001FC 6B6B55AA imul bp,[bp+di+0x55],byte -0x56
Thank you for your suggestions. Bill S.
boots fine on my older pcs but I can't boot it on my newer pc, which has
EFI BIOS. The pc is ASUS VivoBook F512JA-OH36 and has an SSD with Win10
and Ubuntu installed on it. The EFI BIOS is American Megatrends version
302. I have "secure boot" turned off in the BIOS. I have previously
booted other thumb drives on the newer pc (Knoppix and Ubuntu Live) so I
am familiar with booting from a thumb drive on the newer pc.
The OS I want to boot is on partition #1 of a thumb drive. The system
type indicated in the partition table is FAT16 LBA (0x0e) and the boot
flag is set. The boot sector of partition #1 is definitely not a
standard FAT16 LBA boot sector (see listing at the end of this post). It
simply loads the 16 sector OS from partition #1 to 0:0x1000 and performs
a long jump to the code. The boot sector has the standard 55AA signature
at the end. Partition #1 has a lot of space on it besides the boot
sector and the 16 sector OS - it is 32.5 MB. The OS isn't much of an OS,
but rather aspires to be a text editor which operates on files in
partition #2 and #3 of the thumb drive. Partition #2 and #3 are standard
FAT16 LBA partitions - but they are not bootable.
The boot options listed by the EFI BIOS upon initial start up are:
OPTION #1 UBUNTU WDC PC SN520
OPTION #2 WINDOWS WDC PC SN520
OPTION #3 UEFI: USB DISK PARTITION #2
OPTION #4 UEFI: USB DIDK PARTITION #3
You can select one of the USB DISK PARTITIONS to boot by moving and
saving its line to the OPTION #1 position in the EFI BIOS. If the
selected partition is bootable it will be booted when you exit from the
EFI BIOS. The problem is that the system I want to boot is on USB DISK
PARTITION #1, which isn't even listed. For some reason the BIOS does not
include partition #1 as an option for booting.
QUESTION 1: does anyone know why it might not accept partition #1 as a
boot option?
QUESTION 2: can I avoid the problem if I "enroll" a "hash" of something
to the EFI system? If so, I don't know how to do that.
Below is a listing of partition #1 boot sector. Note: the bytes between
the executable code and the 55AA signature are filled with ASCII 0x6B.
00000000 B80000 mov ax,0x0
00000003 8ED0 mov ss,ax
00000005 BCFF7A mov sp,0x7aff
00000008 8ED8 mov ds,ax
0000000A BE007B mov si,0x7b00
0000000D C7041000 mov word [si],0x10
00000011 C744021000 mov word [si+0x2],0x10
00000016 C744040000 mov word [si+0x4],0x0
0000001B C744060010 mov word [si+0x6],0x1000
00000020 C744086002 mov word [si+0x8],0x260
00000025 C7440A0000 mov word [si+0xa],0x0
0000002A C7440C0000 mov word [si+0xc],0x0
0000002F C7440E0000 mov word [si+0xe],0x0
00000034 B442 mov ah,0x42
00000036 B280 mov dl,0x80
00000038 CD13 int 0x13
0000003A 720A jc 0x46
0000003C B8310E mov ax,0xe31
0000003F CD10 int 0x10
00000041 EA00000010 jmp 0x1000:0x0
00000046 B90200 mov cx,0x2
00000049 C1C004 rol ax,byte 0x4
0000004C 50 push ax
0000004D 240F and al,0xf
0000004F 0430 add al,0x30
00000051 3C39 cmp al,0x39
00000053 7602 jna 0x57
00000055 0407 add al,0x7
00000057 B40E mov ah,0xe
00000059 CD10 int 0x10
0000005B 58 pop ax
0000005C 49 dec cx
0000005D 75EA jnz 0x49
0000005F EBFE jmp short 0x5f
00000061 6B6B6B6B imul bp,[bp+di+0x6b],byte +0x6b
00000065 6B6B6B6B imul bp,[bp+di+0x6b],byte +0x6b
00000069 6B6B6B6B imul bp,[bp+di+0x6b],byte +0x6b
000001FC 6B6B55AA imul bp,[bp+di+0x55],byte -0x56
Thank you for your suggestions. Bill S.