OpenCores
URL https://opencores.org/ocsvn/zet86/zet86/trunk

Subversion Repositories zet86

[/] [zet86/] [trunk/] [soc/] [bios/] [rombios.c] - Diff between revs 45 and 46

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 45 Rev 46
Line 440... Line 440...
static void           write_word();
static void           write_word();
static void           bios_printf();
static void           bios_printf();
 
 
static void           int09_function();
static void           int09_function();
static void           int13_harddisk();
static void           int13_harddisk();
 
static void           transf_sect();
static void           int13_diskette_function();
static void           int13_diskette_function();
static void           int16_function();
static void           int16_function();
static void           int19_function();
static void           int19_function();
static Bit16u         get_CS();
static Bit16u         get_CS();
static Bit16u         get_SS();
static Bit16u         get_SS();
Line 960... Line 961...
    jmp halt2_loop
    jmp halt2_loop
ASM_END
ASM_END
    }
    }
}
}
 
 
static char bios_svn_version_string[] = "$Revision: 1.11 $ $Date: 2009-03-02 01:02:32 $";
static char bios_svn_version_string[] = "$Revision: 1.12 $ $Date: 2009-03-03 16:52:58 $";
 
 
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
// print_bios_banner
// print_bios_banner
//   displays a the bios version
//   displays a the bios version
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
Line 1485... Line 1486...
    CLEAR_CF();   // no error
    CLEAR_CF();   // no error
    return;
    return;
}
}
 
 
  void
  void
 
transf_sect(seg, offset)
 
  Bit16u seg;
 
  Bit16u offset;
 
{
 
ASM_START
 
  push bp
 
  mov  bp, sp
 
 
 
    push ax
 
    push bx
 
    push cx
 
    push dx
 
    push di
 
    push ds
 
 
 
    mov  ax, 4[bp] ; segment
 
    mov  ds, ax
 
    mov  bx, 6[bp] ; offset
 
    mov  dx, #0xe000
 
    mov  cx, #256
 
    xor  di, di
 
 
 
one_sect:
 
    in   ax, dx    ; read word from flash
 
    mov  [bx+di], ax ; write word
 
    inc  dx
 
    inc  dx
 
    inc  di
 
    inc  di
 
    loop one_sect
 
 
 
    pop  ds
 
    pop  di
 
    pop  dx
 
    pop  cx
 
    pop  bx
 
    pop  ax
 
 
 
  pop  bp
 
ASM_END
 
}
 
 
 
  void
int13_diskette_function(DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS)
int13_diskette_function(DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS)
  Bit16u DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS;
  Bit16u DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS;
{
{
  Bit8u  drive, num_sectors, track, sector, head, status;
  Bit8u  drive, num_sectors, track, sector, head, status;
  Bit16u base_address, base_count, base_es;
  Bit16u base_address, base_count, base_es;
Line 1551... Line 1595...
        // Configure the sector address
        // Configure the sector address
        for (j=0; j<num_sectors; j++)
        for (j=0; j<num_sectors; j++)
          {
          {
            outw(0xe000, log_sector+j);
            outw(0xe000, log_sector+j);
            base_count = base_address + (j << 9);
            base_count = base_address + (j << 9);
              for (i=0; i<512; i+=2)
            transf_sect (last_addr, base_count);
              {
 
                tmp = inw (0xe000+i);
 
                write_word (last_addr, base_count+i, tmp);
 
              }
 
          }
          }
 
 
        // ??? should track be new val from return_status[3] ?
        // ??? should track be new val from return_status[3] ?
        set_diskette_current_cyl(drive, track);
        set_diskette_current_cyl(drive, track);
        // AL = number of sectors read (same value as passed)
        // AL = number of sectors read (same value as passed)
Line 2101... Line 2141...
  ;; EBDA setup
  ;; EBDA setup
  call ebda_post
  call ebda_post
 
 
  ;; Keyboard
  ;; Keyboard
  SET_INT_VECTOR(0x09, #0xF000, #int09_handler)
  SET_INT_VECTOR(0x09, #0xF000, #int09_handler)
  SET_INT_VECTOR(0x16, #0xF000, #int16_handler)
  ;SET_INT_VECTOR(0x16, #0xF000, #int16_handler)
 
 
  xor  ax, ax
  xor  ax, ax
  mov  ds, ax
  mov  ds, ax
  mov  0x0417, al /* keyboard shift flags, set 1 */
  mov  0x0417, al /* keyboard shift flags, set 1 */
  mov  0x0418, al /* keyboard shift flags, set 2 */
  mov  0x0418, al /* keyboard shift flags, set 2 */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.