root/boot/setup.S

/* [previous][next][first][last][top][bottom][index][help] */
   1 !
   2 !       setup.S         Copyright (C) 1991, 1992 Linus Torvalds
   3 !
   4 ! setup.s is responsible for getting the system data from the BIOS,
   5 ! and putting them into the appropriate places in system memory.
   6 ! both setup.s and system has been loaded by the bootblock.
   7 !
   8 ! This code asks the bios for memory/disk/other parameters, and
   9 ! puts them in a "safe" place: 0x90000-0x901FF, ie where the
  10 ! boot-block used to be. It is then up to the protected mode
  11 ! system to read them from there before the area is overwritten
  12 ! for buffer-blocks.
  13 !
  14 ! Move PS/2 aux init code to psaux.c
  15 ! (troyer@saifr00.cfsat.Honeywell.COM) 03Oct92
  16 !
  17 ! some changes and additional features by Christoph Niemann, March 1993
  18 ! (niemann@rubdv15.ETDV.Ruhr-Uni-Bochum.De)
  19 !
  20 
  21 ! NOTE! These had better be the same as in bootsect.s!
  22 #include <linux/config.h>
  23 
  24 #ifndef SVGA_MODE
  25 #define SVGA_MODE ASK_VGA
  26 #endif
  27 
  28 INITSEG  = DEF_INITSEG  ! we move boot here - out of the way
  29 SYSSEG   = DEF_SYSSEG   ! system loaded at 0x10000 (65536).
  30 SETUPSEG = DEF_SETUPSEG ! this is the current segment
  31 
  32 .globl begtext, begdata, begbss, endtext, enddata, endbss
  33 .text
  34 begtext:
  35 .data
  36 begdata:
  37 .bss
  38 begbss:
  39 .text
  40 
  41 entry start
  42 start:
  43 
  44 ! ok, the read went well so we get current cursor position and save it for
  45 ! posterity.
  46 
  47         mov     ax,#INITSEG     ! this is done in bootsect already, but...
  48         mov     ds,ax
  49 
  50 ! Get memory size (extended mem, kB)
  51 
  52         mov     ah,#0x88
  53         int     0x15
  54         mov     [2],ax
  55 
  56 ! set the keyboard repeat rate to the max
  57 
  58         mov     ax,#0x0305
  59         xor     bx,bx           ! clear bx
  60         int     0x16
  61 
  62 ! check for EGA/VGA and some config parameters
  63 
  64         mov     ah,#0x12
  65         mov     bl,#0x10
  66         int     0x10
  67         mov     [8],ax
  68         mov     [10],bx
  69         mov     [12],cx
  70         mov     ax,#0x5019
  71         cmp     bl,#0x10
  72         je      novga
  73         mov     ax,#0x1a00      ! Added check for EGA/VGA discrimination
  74         int     0x10
  75         mov     bx,ax
  76         mov     ax,#0x5019
  77         cmp     bl,#0x1a        ! 1a means VGA, anything else EGA or lower
  78         jne     novga   
  79         call    chsvga
  80 novga:  mov     [14],ax
  81         mov     ah,#0x03        ! read cursor pos
  82         xor     bh,bh           ! clear bh
  83         int     0x10            ! save it in known place, con_init fetches
  84         mov     [0],dx          ! it from 0x90000.
  85         
  86 ! Get video-card data:
  87         
  88         mov     ah,#0x0f
  89         int     0x10
  90         mov     [4],bx          ! bh = display page
  91         mov     [6],ax          ! al = video mode, ah = window width
  92 
  93 ! Get hd0 data
  94 
  95         xor     ax,ax           ! clear ax
  96         mov     ds,ax
  97         lds     si,[4*0x41]
  98         mov     ax,#INITSEG
  99         mov     es,ax
 100         mov     di,#0x0080
 101         mov     cx,#0x10
 102         cld
 103         rep
 104         movsb
 105 
 106 ! Get hd1 data
 107 
 108         xor     ax,ax           ! clear ax
 109         mov     ds,ax
 110         lds     si,[4*0x46]
 111         mov     ax,#INITSEG
 112         mov     es,ax
 113         mov     di,#0x0090
 114         mov     cx,#0x10
 115         cld
 116         rep
 117         movsb
 118 
 119 ! Check that there IS a hd1 :-)
 120 
 121         mov     ax,#0x01500
 122         mov     dl,#0x81
 123         int     0x13
 124         jc      no_disk1
 125         cmp     ah,#3
 126         je      is_disk1
 127 no_disk1:
 128         mov     ax,#INITSEG
 129         mov     es,ax
 130         mov     di,#0x0090
 131         mov     cx,#0x10
 132         xor     ax,ax           ! clear ax
 133         cld
 134         rep
 135         stosb
 136 is_disk1:
 137 
 138 ! check for PS/2 pointing device
 139 
 140         mov     ax,#INITSEG
 141         mov     ds,ax
 142         mov     [0x1ff],#0      ! default is no pointing device
 143         int     0x11            ! int 0x11: equipment determination
 144         test    al,#0x04        ! check if pointing device installed
 145         jz      no_psmouse
 146         mov     [0x1ff],#0xaa   ! device present
 147 no_psmouse:
 148 ! now we want to move to protected mode ...
 149 
 150         cli                     ! no interrupts allowed !
 151         mov     al,#0x80        ! disable NMI for the bootup sequence
 152         out     #0x70,al
 153 
 154 ! first we move the system to it's rightful place
 155 
 156         xor     ax,ax           ! clear ax
 157         cld                     ! 'direction'=0, movs moves forward
 158 do_move:
 159         mov     es,ax           ! destination segment
 160         add     ax,#0x1000
 161         cmp     ax,#0x9000
 162         jz      end_move
 163         mov     ds,ax           ! source segment
 164         sub     di,di
 165         sub     si,si
 166         mov     cx,#0x8000
 167         rep
 168         movsw
 169         jmp     do_move
 170 
 171 ! then we load the segment descriptors
 172 
 173 end_move:
 174         mov     ax,#SETUPSEG    ! right, forgot this at first. didn't work :-)
 175         mov     ds,ax
 176         lidt    idt_48          ! load idt with 0,0
 177         lgdt    gdt_48          ! load gdt with whatever appropriate
 178 
 179 ! that was painless, now we enable A20
 180 
 181         call    empty_8042
 182         mov     al,#0xD1                ! command write
 183         out     #0x64,al
 184         call    empty_8042
 185         mov     al,#0xDF                ! A20 on
 186         out     #0x60,al
 187         call    empty_8042
 188 
 189 ! make sure any possible coprocessor is properly reset..
 190 
 191         xor     ax,ax
 192         out     #0xf0,al
 193         call    delay
 194         out     #0xf1,al
 195         call    delay
 196 
 197 ! well, that went ok, I hope. Now we have to reprogram the interrupts :-(
 198 ! we put them right after the intel-reserved hardware interrupts, at
 199 ! int 0x20-0x2F. There they won't mess up anything. Sadly IBM really
 200 ! messed this up with the original PC, and they haven't been able to
 201 ! rectify it afterwards. Thus the bios puts interrupts at 0x08-0x0f,
 202 ! which is used for the internal hardware interrupts as well. We just
 203 ! have to reprogram the 8259's, and it isn't fun.
 204 
 205         mov     al,#0x11                ! initialization sequence
 206         out     #0x20,al                ! send it to 8259A-1
 207         call    delay
 208         out     #0xA0,al                ! and to 8259A-2
 209         call    delay
 210         mov     al,#0x20                ! start of hardware int's (0x20)
 211         out     #0x21,al
 212         call    delay
 213         mov     al,#0x28                ! start of hardware int's 2 (0x28)
 214         out     #0xA1,al
 215         call    delay
 216         mov     al,#0x04                ! 8259-1 is master
 217         out     #0x21,al
 218         call    delay
 219         mov     al,#0x02                ! 8259-2 is slave
 220         out     #0xA1,al
 221         call    delay
 222         mov     al,#0x01                ! 8086 mode for both
 223         out     #0x21,al
 224         call    delay
 225         out     #0xA1,al
 226         call    delay
 227         mov     al,#0xFF                ! mask off all interrupts for now
 228         out     #0xA1,al
 229         call    delay
 230         mov     al,#0xFB                ! mask all irq's but irq2 which
 231         out     #0x21,al                ! is cascaded
 232 
 233 ! well, that certainly wasn't fun :-(. Hopefully it works, and we don't
 234 ! need no steenking BIOS anyway (except for the initial loading :-).
 235 ! The BIOS-routine wants lots of unnecessary data, and it's less
 236 ! "interesting" anyway. This is how REAL programmers do it.
 237 !
 238 ! Well, now's the time to actually move into protected mode. To make
 239 ! things as simple as possible, we do no register set-up or anything,
 240 ! we let the gnu-compiled 32-bit programs do that. We just jump to
 241 ! absolute address 0x00000, in 32-bit protected mode.
 242 !
 243 ! Note that the short jump isn't strictly needed, althought there are
 244 ! reasons why it might be a good idea. It won't hurt in any case.
 245 !
 246         mov     ax,#0x0001      ! protected mode (PE) bit
 247         lmsw    ax              ! This is it!
 248         jmp     flush_instr
 249 flush_instr:
 250         jmpi    0,8             ! jmp offset 0 of segment 8 (cs)
 251 
 252 ! This routine checks that the keyboard command queue is empty
 253 ! (after emptying the output buffers)
 254 !
 255 ! No timeout is used - if this hangs there is something wrong with
 256 ! the machine, and we probably couldn't proceed anyway.
 257 empty_8042:
 258         call    delay
 259         in      al,#0x64        ! 8042 status port
 260         test    al,#1           ! output buffer?
 261         jz      no_output
 262         call    delay
 263         in      al,#0x60        ! read it
 264         jmp     empty_8042
 265 no_output:
 266         test    al,#2           ! is input buffer full?
 267         jnz     empty_8042      ! yes - loop
 268         ret
 269 !
 270 ! Read a key and return the (US-)ascii code in al, scan code in ah
 271 !
 272 getkey:
 273         xor     ah,ah
 274         int     0x16
 275         ret
 276 
 277 !
 278 ! Read a key with a timeout of 30 seconds. The cmos clock is used to get
 279 ! the time.
 280 !
 281 getkt:
 282         call    gettime
 283         add     al,#30          ! wait 30 seconds
 284         cmp     al,#60
 285         jl      lminute
 286         sub     al,#60
 287 lminute:
 288         mov     cl,al
 289 again:  mov     ah,#0x01
 290         int     0x16
 291         jnz     getkey          ! key pressed, so get it
 292         call    gettime
 293         cmp     al,cl
 294         jne     again
 295         mov     al,#0x20        ! timeout, return default char `space'
 296         ret
 297 
 298 !
 299 ! Flush the keyboard buffer
 300 !
 301 flush:  mov     ah,#0x01
 302         int     0x16
 303         jz      empty
 304         xor     ah,ah
 305         int     0x16
 306         jmp     flush
 307 empty:  ret
 308 
 309 !
 310 ! Read the cmos clock. Return the seconds in al
 311 !
 312 gettime:
 313         push    cx
 314         mov     ah,#0x02
 315         int     0x1a
 316         mov     al,dh                   ! dh contains the seconds
 317         and     al,#0x0f
 318         mov     ah,dh
 319         mov     cl,#0x04
 320         shr     ah,cl
 321         aad
 322         pop     cx
 323         ret
 324 
 325 !
 326 ! Delay is needed after doing i/o
 327 !
 328 delay:
 329         .word   0x00eb                  ! jmp $+2
 330         ret
 331 
 332 ! Routine trying to recognize type of SVGA-board present (if any)
 333 ! and if it recognize one gives the choices of resolution it offers.
 334 ! If one is found the resolution chosen is given by al,ah (rows,cols).
 335 
 336 chsvga: cld
 337         push    ds
 338         push    cs
 339         mov     ax,[0x01fa]
 340         pop     ds
 341         mov     modesave,ax
 342         mov     ax,#0xc000
 343         mov     es,ax
 344         mov     ax,modesave
 345         cmp     ax,#NORMAL_VGA
 346         je      defvga
 347         cmp     ax,#EXTENDED_VGA
 348         je      vga50
 349         cmp     ax,#ASK_VGA
 350         jne     svga
 351         lea     si,msg1
 352         call    prtstr
 353         call    flush
 354 nokey:  call    getkt
 355         cmp     al,#0x0d                ! enter ?
 356         je      svga                    ! yes - svga selection
 357         cmp     al,#0x20                ! space ?
 358         je      defvga                  ! no - repeat
 359         call    beep
 360         jmp     nokey
 361 defvga: mov     ax,#0x5019
 362         pop     ds
 363         ret
 364 /* extended vga mode: 80x50 */
 365 vga50:
 366         mov     ax,#0x1112
 367         xor     bl,bl
 368         int     0x10            ! use 8x8 font set (50 lines on VGA)
 369         mov     ax,#0x1200
 370         mov     bl,#0x20
 371         int     0x10            ! use alternate print screen
 372         mov     ax,#0x1201
 373         mov     bl,#0x34
 374         int     0x10            ! turn off cursor emulation
 375         mov     ah,#0x01
 376         mov     cx,#0x0607
 377         int     0x10            ! turn on cursor (scan lines 6 to 7)
 378         pop     ds
 379         mov     ax,#0x5032      ! return 80x50
 380         ret
 381 /* extended vga mode: 80x28 */
 382 vga28:
 383         pop     ax              ! clean the stack
 384         mov     ax,#0x1111
 385         xor     bl,bl
 386         int     0x10            ! use 9x14 fontset (28 lines on VGA)
 387         mov     ah, #0x01
 388         mov     cx,#0x0b0c
 389         int     0x10            ! turn on cursor (scan lines 11 to 12)
 390         pop     ds
 391         mov     ax,#0x501c      ! return 80x28
 392         ret
 393 /* svga modes */
 394 svga:   cld     
 395         lea     si,idf1280      ! Check for Orchid F1280 (dingbat@diku.dk)
 396         mov     di,#0x10a       ! id string is at c000:010a
 397         mov     cx,#0x21        ! length
 398         repe
 399         cmpsb
 400         jne     nf1280  
 401 isVRAM: lea     si,dscf1280
 402         lea     di,mof1280
 403         br      selmod
 404 nf1280: lea     si,idVRAM
 405         mov     di,#0x10a
 406         mov     cx,#0x0c
 407         repe
 408         cmpsb
 409         je      isVRAM
 410         cld
 411         lea     si,idati                ! Check ATI 'clues'
 412         mov     di,#0x31
 413         mov     cx,#0x09
 414         repe
 415         cmpsb
 416         jne     noati
 417         lea     si,dscati
 418         lea     di,moati
 419         br      selmod
 420 noati:  mov     ax,#0x200f              ! Check Ahead 'clues'
 421         mov     dx,#0x3ce
 422         out     dx,ax
 423         inc     dx
 424         in      al,dx
 425         cmp     al,#0x20
 426         je      isahed
 427         cmp     al,#0x21
 428         jne     noahed
 429 isahed: lea     si,dscahead
 430         lea     di,moahead
 431         br      selmod
 432 noahed: mov     dx,#0x3c3               ! Check Chips & Tech. 'clues'
 433         in      al,dx
 434         or      al,#0x10
 435         out     dx,al
 436         mov     dx,#0x104               
 437         in      al,dx
 438         mov     bl,al
 439         mov     dx,#0x3c3
 440         in      al,dx
 441         and     al,#0xef
 442         out     dx,al
 443         cmp     bl,[idcandt]
 444         jne     nocant
 445         lea     si,dsccandt
 446         lea     di,mocandt
 447         br      selmod
 448 nocant: mov     dx,#0x3d4               ! Check Cirrus 'clues'
 449         mov     al,#0x0c
 450         out     dx,al
 451         inc     dx
 452         in      al,dx
 453         mov     bl,al
 454         xor     al,al
 455         out     dx,al
 456         dec     dx
 457         mov     al,#0x1f
 458         out     dx,al
 459         inc     dx
 460         in      al,dx
 461         mov     bh,al
 462         xor     ah,ah
 463         shl     al,#4
 464         mov     cx,ax
 465         mov     al,bh
 466         shr     al,#4
 467         add     cx,ax
 468         shl     cx,#8
 469         add     cx,#6
 470         mov     ax,cx
 471         mov     dx,#0x3c4
 472         out     dx,ax
 473         inc     dx
 474         in      al,dx
 475         and     al,al
 476         jnz     nocirr
 477         mov     al,bh
 478         out     dx,al
 479         in      al,dx
 480         cmp     al,#0x01
 481         jne     nocirr
 482         call    rst3d4  
 483         lea     si,dsccirrus
 484         lea     di,mocirrus
 485         br      selmod
 486 rst3d4: mov     dx,#0x3d4
 487         mov     al,bl
 488         xor     ah,ah
 489         shl     ax,#8
 490         add     ax,#0x0c
 491         out     dx,ax
 492         ret     
 493 nocirr: call    rst3d4                  ! Check Everex 'clues'
 494         mov     ax,#0x7000
 495         xor     bx,bx
 496         int     0x10
 497         cmp     al,#0x70
 498         jne     noevrx
 499         shr     dx,#4
 500         cmp     dx,#0x678
 501         je      istrid
 502         cmp     dx,#0x236
 503         je      istrid
 504         lea     si,dsceverex
 505         lea     di,moeverex
 506         br      selmod
 507 istrid: lea     cx,ev2tri
 508         jmp     cx
 509 noevrx: lea     si,idgenoa              ! Check Genoa 'clues'
 510         xor     ax,ax
 511         seg es
 512         mov     al,[0x37]
 513         mov     di,ax
 514         mov     cx,#0x04
 515         dec     si
 516         dec     di
 517 l1:     inc     si
 518         inc     di
 519         mov     al,(si)
 520         test    al,al
 521         jz      l2
 522         seg es
 523         cmp     al,(di)
 524 l2:     loope   l1
 525         cmp     cx,#0x00
 526         jne     nogen
 527         lea     si,dscgenoa
 528         lea     di,mogenoa
 529         br      selmod
 530 nogen:  cld
 531         lea     si,idoakvga
 532         mov     di,#0x08
 533         mov     cx,#0x08
 534         repe
 535         cmpsb
 536         jne     nooak
 537         lea     si,dscoakvga
 538         lea     di,mooakvga
 539         br      selmod
 540 nooak:  cld
 541         lea     si,idparadise           ! Check Paradise 'clues'
 542         mov     di,#0x7d
 543         mov     cx,#0x04
 544         repe
 545         cmpsb
 546         jne     nopara
 547         lea     si,dscparadise
 548         lea     di,moparadise
 549         br      selmod
 550 nopara: mov     dx,#0x3c4               ! Check Trident 'clues'
 551         mov     al,#0x0e
 552         out     dx,al
 553         inc     dx
 554         in      al,dx
 555         xchg    ah,al
 556         xor     al,al
 557         out     dx,al
 558         in      al,dx
 559         xchg    al,ah
 560         mov     bl,al           ! Strange thing ... in the book this wasn't
 561         and     bl,#0x02        ! necessary but it worked on my card which
 562         jz      setb2           ! is a trident. Without it the screen goes
 563         and     al,#0xfd        ! blurred ...
 564         jmp     clrb2           !
 565 setb2:  or      al,#0x02        !
 566 clrb2:  out     dx,al
 567         and     ah,#0x0f
 568         cmp     ah,#0x02
 569         jne     notrid
 570 ev2tri: lea     si,dsctrident
 571         lea     di,motrident
 572         jmp     selmod
 573 notrid: mov     dx,#0x3cd               ! Check Tseng 'clues'
 574         in      al,dx                   ! Could things be this simple ! :-)
 575         mov     bl,al
 576         mov     al,#0x55
 577         out     dx,al
 578         in      al,dx
 579         mov     ah,al
 580         mov     al,bl
 581         out     dx,al
 582         cmp     ah,#0x55
 583         jne     notsen
 584         lea     si,dsctseng
 585         lea     di,motseng
 586         jmp     selmod
 587 notsen: mov     dx,#0x3cc               ! Check Video7 'clues'
 588         in      al,dx
 589         mov     dx,#0x3b4
 590         and     al,#0x01
 591         jz      even7
 592         mov     dx,#0x3d4
 593 even7:  mov     al,#0x0c
 594         out     dx,al
 595         inc     dx
 596         in      al,dx
 597         mov     bl,al
 598         mov     al,#0x55
 599         out     dx,al
 600         in      al,dx
 601         dec     dx
 602         mov     al,#0x1f
 603         out     dx,al
 604         inc     dx
 605         in      al,dx
 606         mov     bh,al
 607         dec     dx
 608         mov     al,#0x0c
 609         out     dx,al
 610         inc     dx
 611         mov     al,bl
 612         out     dx,al
 613         mov     al,#0x55
 614         xor     al,#0xea
 615         cmp     al,bh
 616         jne     novid7
 617         lea     si,dscvideo7
 618         lea     di,movideo7
 619         jmp     selmod
 620 novid7: lea     si,dsunknown
 621         lea     di,mounknown
 622 selmod: xor     cx,cx
 623         mov     cl,(di)
 624         mov     ax,modesave
 625         cmp     ax,#ASK_VGA
 626         je      askmod
 627         cmp     ax,#NORMAL_VGA
 628         je      askmod
 629         cmp     al,cl
 630         jl      gotmode
 631         push    si
 632         lea     si,msg4
 633         call    prtstr
 634         pop     si
 635 askmod: push    si
 636         lea     si,msg2
 637         call    prtstr
 638         pop     si
 639         push    si
 640         push    cx
 641 tbl:    pop     bx
 642         push    bx
 643         mov     al,bl
 644         sub     al,cl
 645         call    modepr
 646         lodsw
 647         xchg    al,ah
 648         call    dprnt
 649         xchg    ah,al
 650         push    ax
 651         mov     al,#0x78
 652         call    prnt1
 653         pop     ax
 654         call    dprnt
 655         push    si
 656         lea     si,crlf         ! print CR+LF
 657         call    prtstr
 658         pop     si
 659         loop    tbl
 660         pop     cx
 661         lea     si,msg3
 662         call    prtstr
 663         pop     si
 664         add     cl,#0x30
 665         jmp     nonum
 666 nonumb: call    beep
 667 nonum:  call    getkey
 668         cmp     al,#0x30        ! ascii `0'
 669         jb      nonumb
 670         cmp     al,#0x3a        ! ascii `9'
 671         jbe     number
 672         cmp     al,#0x61        ! ascii `a'
 673         jb      nonumb
 674         cmp     al,#0x7a        ! ascii `z'
 675         ja      nonumb
 676         sub     al,#0x27
 677         cmp     al,cl
 678         jae     nonumb
 679         sub     al,#0x30
 680         jmp     gotmode
 681 number: cmp     al,cl
 682         jae     nonumb
 683         sub     al,#0x30
 684 gotmode:        xor     ah,ah
 685         or      al,al
 686         beq     vga50
 687         push    ax
 688         dec     ax
 689         beq     vga28
 690         add     di,ax
 691         mov     al,(di)
 692         int     0x10
 693         pop     ax
 694         shl     ax,#1
 695         add     si,ax
 696         lodsw
 697         pop     ds
 698         ret
 699 
 700 ! Routine to print asciiz-string at DS:SI
 701 
 702 prtstr: lodsb
 703         and     al,al
 704         jz      fin
 705         call    prnt1
 706         jmp     prtstr
 707 fin:    ret
 708 
 709 ! Routine to print a decimal value on screen, the value to be
 710 ! printed is put in al (i.e 0-255). 
 711 
 712 dprnt:  push    ax
 713         push    cx
 714         xor     ah,ah           ! Clear ah
 715         mov     cl,#0x0a
 716         idiv    cl
 717         cmp     al,#0x09
 718         jbe     lt100
 719         call    dprnt
 720         jmp     skip10
 721 lt100:  add     al,#0x30
 722         call    prnt1
 723 skip10: mov     al,ah
 724         add     al,#0x30
 725         call    prnt1   
 726         pop     cx
 727         pop     ax
 728         ret
 729 
 730 !
 731 ! Routine to print the mode number key on screen. Mode numbers
 732 ! 0-9 print the ascii values `0' to '9', 10-35 are represented by
 733 ! the letters `a' to `z'. This routine prints some spaces around the
 734 ! mode no.
 735 !
 736 
 737 modepr: push    ax
 738         cmp     al,#0x0a
 739         jb      digit           ! Here is no check for number > 35
 740         add     al,#0x27
 741 digit:  add     al,#0x30
 742         mov     modenr, al
 743         push    si
 744         lea     si, modestring
 745         call    prtstr
 746         pop     si
 747         pop     ax
 748         ret
 749 
 750 ! Part of above routine, this one just prints ascii al
 751 
 752 prnt1:  push    ax
 753         push    cx
 754         xor     bh,bh
 755         mov     cx,#0x01
 756         mov     ah,#0x0e
 757         int     0x10
 758         pop     cx
 759         pop     ax
 760         ret
 761 
 762 beep:   mov     al,#0x07
 763         jmp     prnt1
 764         
 765 gdt:
 766         .word   0,0,0,0         ! dummy
 767 
 768         .word   0x07FF          ! 8Mb - limit=2047 (2048*4096=8Mb)
 769         .word   0x0000          ! base address=0
 770         .word   0x9A00          ! code read/exec
 771         .word   0x00C0          ! granularity=4096, 386
 772 
 773         .word   0x07FF          ! 8Mb - limit=2047 (2048*4096=8Mb)
 774         .word   0x0000          ! base address=0
 775         .word   0x9200          ! data read/write
 776         .word   0x00C0          ! granularity=4096, 386
 777 
 778 idt_48:
 779         .word   0                       ! idt limit=0
 780         .word   0,0                     ! idt base=0L
 781 
 782 gdt_48:
 783         .word   0x800           ! gdt limit=2048, 256 GDT entries
 784         .word   512+gdt,0x9     ! gdt base = 0X9xxxx
 785 
 786 msg1:           .ascii  "Press <RETURN> to see SVGA-modes available, <SPACE> to continue or wait 30 secs."
 787                 db      0x0d, 0x0a, 0x0a, 0x00
 788 msg2:           .ascii  "Mode:  COLSxROWS:"
 789                 db      0x0d, 0x0a, 0x0a, 0x00
 790 msg3:           db      0x0d, 0x0a
 791                 .ascii  "Choose mode by pressing the corresponding number or letter."
 792 crlf:           db      0x0d, 0x0a, 0x00
 793 msg4:           .ascii  "You passed an undefined mode number to setup. Please choose a new mode."
 794                 db      0x0d, 0x0a, 0x0a, 0x07, 0x00
 795 modestring:     .ascii  "   "
 796 modenr:         db      0x00    ! mode number
 797                 .ascii  ":    "
 798                 db      0x00
 799                 
 800 idati:          .ascii  "761295520"
 801 idcandt:        .byte   0xa5
 802 idgenoa:        .byte   0x77, 0x00, 0x99, 0x66
 803 idparadise:     .ascii  "VGA="
 804 idoakvga:       .ascii  "OAK VGA "
 805 idf1280:        .ascii  "Orchid Technology Fahrenheit 1280"
 806 idVRAM:         .ascii  "Stealth VRAM"
 807 
 808 ! Manufacturer:   Numofmodes+2: Mode:
 809 ! Number of modes is the number of chip-specific svga modes plus the extended
 810 ! modes available on any vga (currently 2)
 811 
 812 moati:          .byte   0x04,   0x23, 0x33 
 813 moahead:        .byte   0x07,   0x22, 0x23, 0x24, 0x2f, 0x34
 814 mocandt:        .byte   0x04,   0x60, 0x61
 815 mocirrus:       .byte   0x06,   0x1f, 0x20, 0x22, 0x31
 816 moeverex:       .byte   0x0c,   0x03, 0x04, 0x07, 0x08, 0x0a, 0x0b, 0x16, 0x18, 0x21, 0x40
 817 mogenoa:        .byte   0x0c,   0x58, 0x5a, 0x60, 0x61, 0x62, 0x63, 0x64, 0x72, 0x74, 0x78
 818 moparadise:     .byte   0x04,   0x55, 0x54
 819 motrident:      .byte   0x09,   0x50, 0x51, 0x52, 0x57, 0x58, 0x59, 0x5a
 820 motseng:        .byte   0x07,   0x26, 0x2a, 0x23, 0x24, 0x22
 821 movideo7:       .byte   0x08,   0x40, 0x43, 0x44, 0x41, 0x42, 0x45
 822 mooakvga:       .byte   0x07,   0x00, 0x07, 0x4f, 0x50, 0x51
 823 mof1280:        .byte   0x04,   0x54, 0x55
 824 mounknown:      .byte   0x02
 825 
 826 !                       msb = Cols lsb = Rows:
 827 ! The first two modes are standard vga modes available on any vga.
 828 ! mode 0 is 80x50 and mode 1 is 80x28
 829 
 830 dscati:         .word   0x5032, 0x501c, 0x8419, 0x842c
 831 dscahead:       .word   0x5032, 0x501c, 0x842c, 0x8419, 0x841c, 0xa032, 0x5042
 832 dsccandt:       .word   0x5032, 0x501c, 0x8419, 0x8432
 833 dsccirrus:      .word   0x5032, 0x501c, 0x8419, 0x842c, 0x841e, 0x6425
 834 dsceverex:      .word   0x5032, 0x501c, 0x5022, 0x503c, 0x642b, 0x644b, 0x8419, 0x842c, 0x501e, 0x641b, 0xa040, 0x841e
 835 dscgenoa:       .word   0x5032, 0x501c, 0x5020, 0x642a, 0x8419, 0x841d, 0x8420, 0x842c, 0x843c, 0x503c, 0x5042, 0x644b
 836 dscparadise:    .word   0x5032, 0x501c, 0x8419, 0x842b
 837 dsctrident:     .word   0x5032, 0x501c, 0x501e, 0x502b, 0x503c, 0x8419, 0x841e, 0x842b, 0x843c
 838 dsctseng:       .word   0x5032, 0x501c, 0x503c, 0x6428, 0x8419, 0x841c, 0x842c
 839 dscvideo7:      .word   0x5032, 0x501c, 0x502b, 0x503c, 0x643c, 0x8419, 0x842c, 0x841c
 840 dscoakvga:      .word   0x5032, 0x501c, 0x2819, 0x5019, 0x843c, 0x8419, 0x842C
 841 dscf1280:       .word   0x5032, 0x501c, 0x842b, 0x8419
 842 dsunknown:      .word   0x5032, 0x501c
 843 modesave:       .word   SVGA_MODE
 844 
 845         
 846 .text
 847 endtext:
 848 .data
 849 enddata:
 850 .bss
 851 endbss:

/* [previous][next][first][last][top][bottom][index][help] */