From 5d34a990dcdee41c2f8e8d5ad2b5b95dbb4ace12 Mon Sep 17 00:00:00 2001 From: Maarten Bosma Date: Wed, 3 Jan 2007 21:46:46 +0000 Subject: [PATCH] Boot sector for regression tests: Do always boot hdd if there is a MDR, otherwise always start the installation. svn path=/trunk/; revision=25287 --- reactos/boot/freeldr/bootsect/isobtrt.asm | 53 +++++------------------ 1 file changed, 10 insertions(+), 43 deletions(-) diff --git a/reactos/boot/freeldr/bootsect/isobtrt.asm b/reactos/boot/freeldr/bootsect/isobtrt.asm index 1a125d76eb6..23fd6494a78 100644 --- a/reactos/boot/freeldr/bootsect/isobtrt.asm +++ b/reactos/boot/freeldr/bootsect/isobtrt.asm @@ -41,8 +41,6 @@ ; Note: The Makefile builds one version with DEBUG_MESSAGES automatically. ;%define DEBUG_MESSAGES ; Uncomment to get debugging messages -%define WAIT_FOR_KEY - ; --------------------------------------------------------------------------- ; BEGIN THE BIOS/CODE/DATA SEGMENT @@ -137,47 +135,22 @@ relocate: call writestr %endif +; check if there is a mbr on the hdd if so boot from it - ; Make sure the keyboard buffer is empty -%ifdef WAIT_FOR_KEY -.kbd_buffer_test: - call pollchar - jz .kbd_buffer_empty - call getchar - jmp .kbd_buffer_test -.kbd_buffer_empty: - - ; Check if there is harddisk pusha - mov ax, 0800h + mov ax, 0201h mov dx, 0080h + mov cx, 0001h + mov bx, trackbuf int 13h popa - jmp .boot_cdrom - - ; Display the 'Press key' message and wait for a maximum of 5 seconds - call crlf - mov si, presskey_msg ; si points to 'Press key' message - call writestr ; display the message - - mov byte [TimeoutCount], 5 -.next_second: - mov eax, [BIOS_timer] ; load current tick counter - add eax, 19 ; + jc .boot_cdrom ; could not read hdd -.poll_again: - call pollchar - jnz .boot_cdrom - - mov ebx, [BIOS_timer] - cmp eax, ebx - jnz .poll_again - - mov si, dot_msg ; print '.' - call writestr - dec byte [TimeoutCount] ; decrement timeout counter - jz .boot_harddisk - jmp .next_second + push ax + mov ax, word [trackbuf+510] + cmp ax, 0 + je .boot_cdrom ; no boot sector found (hopefully there are no weird bootsectors which begin with 0) + pop ax .boot_harddisk: call crlf @@ -199,14 +172,8 @@ relocate: mov dx, 0080h jmp 0:0x7C00 -%endif .boot_cdrom: -%ifdef WAIT_FOR_KEY - call crlf - call crlf -%endif - ; Save and display the boot drive number mov [DriveNo], dl %ifdef DEBUG_MESSAGES -- 2.17.1