[BACK]Return to pbr.S CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / i386 / stand / bootxx

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/i386/stand/bootxx/pbr.S between version 1.18 and 1.19

version 1.18, 2011/01/02 02:01:58 version 1.19, 2011/01/06 01:08:48
Line 97 
Line 97 
  * sector we were loaded from (if we were loaded by NetBSD mbr code).   * sector we were loaded from (if we were loaded by NetBSD mbr code).
  * In any case we have to re-read sector zero of the disk and hunt   * In any case we have to re-read sector zero of the disk and hunt
  * through the BIOS partition table for the NetBSD partition.   * through the BIOS partition table for the NetBSD partition.
    * However, if there's a magic number in %eax, then %ecx:%ebx
    * contains the sector we were loaded from.
  */   */
   
         .text          .text
Line 119  ENTRY(start)
Line 121  ENTRY(start)
   
         . = start + MBR_AFTERBPB        /* skip BPB */          . = start + MBR_AFTERBPB        /* skip BPB */
 start0:  start0:
   #ifndef BOOT_FROM_FAT
           movl    %eax, %edi              /* move %eax magic out of the way */
   #endif
         xor     %ax, %ax                /* don't trust values of ds, es or ss */          xor     %ax, %ax                /* don't trust values of ds, es or ss */
         mov     %ax, %ds          mov     %ax, %ds
         mov     %ax, %es          mov     %ax, %es
         mov     %ax, %ss          mov     %ax, %ss
         mov     $0xfffc, %sp          mov     $0xfffc, %sp
   
   #ifndef BOOT_FROM_FAT
           cmpl    $X86_MBR_GPT_MAGIC, %edi /* did mbr_gpt leave us a LBA? */
           je      boot_gpt
   #endif
   
         /* A 'reset disk system' request is traditional here... */          /* A 'reset disk system' request is traditional here... */
         push    %dx                     /* some BIOS zap %dl here :-( */          push    %dx                     /* some BIOS zap %dl here :-( */
         int     $0x13                   /* ah == 0 from code above */          int     $0x13                   /* ah == 0 from code above */
Line 332  pbr_read_ok:
Line 342  pbr_read_ok:
         jnz     error          jnz     error
   
         movl    %ebp, %esi                      /* %esi ptn base, %dl disk id */          movl    %ebp, %esi                      /* %esi ptn base, %dl disk id */
           movl    lba_sector + 4, %edi            /* %edi ptn base high */
         jmp     $0, $bootxx                     /* our %cs may not be zero */          jmp     $0, $bootxx                     /* our %cs may not be zero */
   
 /* Read disk using int13-extension parameter block */  /* Read disk using int13-extension parameter block */
Line 355  chs_read:
Line 366  chs_read:
         movw    $0x200 + BOOTXX_SECTORS, %ax    /* command 2, xx sectors */          movw    $0x200 + BOOTXX_SECTORS, %ax    /* command 2, xx sectors */
         jmp     do_read          jmp     do_read
   
   #ifndef BOOT_FROM_FAT
   boot_gpt:
           /* 64-bit LBA in %ecx:%ebx */
           movl    %ebx, lba_sector
           movl    %ecx, lba_sector + 4
           movl    %ebx, %ebp
           jmp     boot_lba
   #endif
   
 _errtxt: .ascii "Error "                        /* runs into newline... */  _errtxt: .ascii "Error "                        /* runs into newline... */
 _errcod: .byte  0                               /* ... if errcod set */  _errcod: .byte  0                               /* ... if errcod set */
 _newline:  _newline:
         .asciz  "\r\n"          .asciz  "\r\n"
   
 #ifndef TERSE_ERROR  #ifndef TERSE_ERROR
 ERR_READ:       .asciz  "Disk read"  ERR_READ:       .asciz  "read"
 ERR_NO_BOOTXX:  .asciz  "Not a bootxx image"  ERR_NO_BOOTXX:  .asciz  "no magic"
 ERR_PTN:        .asciz  "No NetBSD partition"  ERR_PTN:        .asciz  "no slice"
 #ifndef NO_LBA_CHECK  #ifndef NO_LBA_CHECK
 ERR_NO_LBA:     .asciz  "Invalid CHS read"  ERR_NO_LBA:     .asciz  "need LBA"
 #endif  #endif
 #endif  #endif
   
Line 387  _lba_info:
Line 407  _lba_info:
         .word   BOOTADDR                        /* offset in segment */          .word   BOOTADDR                        /* offset in segment */
         .word   0                               /* segment */          .word   0                               /* segment */
 _lba_sector:  _lba_sector:
         .long   0x0000                          /* sector # goes here... */          .quad   0                               /* sector # goes here... */
         .long   0x0000  
   
 /* Drive Serial Number */  /* Drive Serial Number */
         . = _C_LABEL(start) + MBR_DSN_OFFSET          . = _C_LABEL(start) + MBR_DSN_OFFSET

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

CVSweb <webmaster@jp.NetBSD.org>