llshell.inc

Go to the documentation of this file.
00001 jmp llshell_out
00002 
00003 // (c) 2004 Bryan Chafy,  This program is released under the GPL
00004 
00005 // LLShell, A low level interactive debug shell
00006 // Designed to be an interactive shell that operates with zero
00007 // system resources.  For example at initial boot.
00008 
00009 // to use, jump to label "low_level_shell" 
00010 // set %esp to the return address for exiting
00011 
00012 
00013 #define UART_BASEADDR $0x3f8  
00014 #define resultreg %esi
00015 #define subroutinereg %edi
00016 #define freqtime $2193  // 1.93 * freq
00017 #define timertime $6000
00018 .equ    sys_IOPL, 110           
00019 
00020 // .data
00021 // .text
00022 
00023 welcome:
00024         .string "\r\n! Low Level Shell (LLShell)  (c)2004 Bryan Chafy \r\n\r\n"
00025 prompt:
00026         .string "\r\n!> "
00027 badcmd:
00028         .string "bad command\r\n"
00029 sorry:
00030         .string "sorry, not yet implemented\r\n"
00031 cmds:
00032         .string "\r\nList of commands:\r\n \
00033 \r\nbeep                    -- pc speaker beep \
00034 \r\nrst (or RST)            -- reset \
00035 \r\nout(b,w,l) <val> <port> -- raw out val at port \
00036 \r\nin(b,w,l)  <port>       -- show raw port value \
00037 \r\njmp  <address>          -- jmp to address (llshell addr is in eax) \
00038 \r\ncall <address>          -- funcion call (assumes a working stack) \
00039 \r\ncli                     -- clear interrupts \
00040 \r\nsti                     -- enable interrupts \
00041 \r\npush <value>            -- push value onto stack \
00042 \r\npop                     -- pop from stack and display \
00043 \r\nwm(b,w,l) <addr> <val>  -- write mem \
00044 \r\ndm   <addr> <lines>     -- dump mem  \
00045 \r\nmcp  <src> <dst> <size> -- mem copy  \
00046 \r\nmpat <pat> <dst> <size> -- mem pattern \
00047 \r\nmemt <begin> <end>      -- memory test \
00048 \r\npcir(b,w,l) <loc>       -- pci read config \
00049 \r\npciw(b,w,l) <loc> <val> -- pci write config  \
00050 \r\ndl   <addr> <size>      -- memory download (display xor cheksum at completion) \
00051 \r\ncram <addr> <size>      -- enable cache to be ram (experimental) \
00052 \r\nbaud <val>              -- change baudrate (not yet implemented)  \
00053 \r\nexit                    -- exit shell \
00054 \r\nAll values in hex (0x prefixing ok)  \
00055 \r\n"
00056 
00057 cr:     
00058         .string "\r\n"
00059 spaces:     
00060         .string "   "
00061 
00062 // .globl _start
00063 //ASSUME CS:@CODE, DS:@DATA
00064 
00065 // _start:
00066 
00067 // call ioperms
00068 
00069 low_level_shell:
00070 
00071 mov $preamble,subroutinereg
00072 jmp beep
00073 preamble:
00074 mov $welcome,resultreg
00075 mov $readcommand,subroutinereg
00076 jmp displaystring
00077 
00078 readcommand:
00079 mov $prompt,resultreg
00080 mov $rcmd,subroutinereg
00081 jmp displaystring
00082 
00083 rcmd:
00084 mov $readcommand,subroutinereg
00085 movl $0x0, resultreg
00086 
00087 readchar:
00088 mov  UART_BASEADDR+5,%dx
00089 in   %dx, %al
00090 and  $0x9f,%al
00091 test $0x01,%al
00092 jz   readchar
00093 mov  UART_BASEADDR,%dx
00094 in   %dx,%al             //char in al
00095 xchg %al,%ah
00096 
00097 send_char:
00098 mov  UART_BASEADDR+5,%dx
00099 us_wait:
00100 in   %dx,%al
00101 test $0x20,%al
00102 jz us_wait
00103 mov  UART_BASEADDR,%dx
00104 xchg %al,%ah
00105 out  %al,%dx            // output char
00106 
00107 cmp  $0x0D,%al      //CR
00108 jnz  eval_char
00109 mov  $0x0A,%ah
00110 jmp  send_char
00111 
00112 eval_char:
00113 cmp  $0x20,%al      //space
00114 jz   cmdtable
00115 cmp  $0x0A,%al      //CR
00116 jz   cmdtable
00117 cmp  $0x08,%al      //BS
00118 jnz  additup
00119 //subit:
00120 shr  $0x8,resultreg
00121 jmp  readchar
00122 additup:
00123 shl  $0x8,resultreg
00124 and  $0xff,%eax
00125 add  %eax,resultreg
00126 jmp  readchar
00127 
00128 cmdtable:
00129 mov resultreg,%eax
00130 cmp $0,%eax
00131 jz  readcommand
00132 cmp $0x74657374,%eax
00133 jz  dotest
00134 cmp $0x68656c70,%eax
00135 jz  dohelp
00136 cmp $0x0000003f,%eax
00137 jz  dohelp
00138 cmp $0x6f757462,%eax
00139 jz  dooutb
00140 cmp $0x6f757477,%eax
00141 jz  dooutw
00142 cmp $0x6f75746c,%eax
00143 jz  dooutd
00144 cmp $0x00696e62,%eax
00145 jz doinb
00146 cmp $0x00696e77,%eax
00147 jz doinw
00148 cmp $0x00696e6c,%eax
00149 jz doind
00150 cmp $0x63697262,%eax
00151 jz pcirb
00152 cmp $0x63697277,%eax
00153 jz pcirw
00154 cmp $0x6369726c,%eax
00155 jz pcirl
00156 cmp $0x63697762,%eax
00157 jz pciwb
00158 cmp $0x63697777,%eax
00159 jz pciww
00160 cmp $0x6369776c,%eax
00161 jz pciwl
00162 cmp $0x00776d62,%eax
00163 jz  wmemb
00164 cmp $0x00776d77,%eax
00165 jz  wmemw
00166 cmp $0x00776d6c,%eax
00167 jz  wmeml
00168 cmp $0x0000646d,%eax
00169 jz  dodmem  
00170 cmp $0x6d656d74,%eax
00171 jz  memt                    // mem test
00172 cmp $0x00727374,%eax
00173 jz  rst                     // reset
00174 cmp $0x00525354,%eax
00175 jz  RST
00176 cmp $0x62656570,%eax
00177 jz  beep   
00178 cmp $0x0000646c,%eax
00179 jz  dodl                    // download to mem <loc> <size>
00180 cmp $0x006a6d70,%eax
00181 jz  jmpto                   // jump to location (eax holds return addr)
00182 cmp $0x62617564,%eax
00183 jz  baud                    // change baudrate
00184 cmp $0x00696e74,%eax
00185 jz  doint                   // trigger an interrupt 
00186 cmp $0x63616c6c,%eax
00187 jz  callto                  // call assumes memory
00188 cmp $0x70757368,%eax
00189 jz  dopush                  // assumes mem
00190 cmp $0x00706f70,%eax
00191 jz  dopop                   // assumes mem
00192 cmp $0x6372616d,%eax
00193 jz  cram                    // cache ram trick <location> <size>
00194 cmp $0x006d6370,%eax
00195 jz  mcp                     // mem copy <src> <dst> <size>
00196 cmp $0x6d706174,%eax
00197 jz  dopattern
00198 cmp $0x00636c69,%eax
00199 jz docli
00200 cmp $0x00737469,%eax
00201 jz dosti
00202 cmp $0x65786974,%eax
00203 jz  doexit
00204 mov $badcmd,resultreg
00205 mov $readcommand,subroutinereg
00206 jmp displaystring
00207 
00208 
00209 readnibbles:
00210 movl $0x0, resultreg
00211 readit:
00212 mov  UART_BASEADDR+5,%dx
00213 in   %dx, %al
00214 and  $0x9f,%al
00215 test $0x1,%al
00216 jz   readit
00217 mov  UART_BASEADDR,%dx
00218 in   %dx,%al
00219 xchg %al,%ah
00220 
00221 sendchar:
00222 mov  UART_BASEADDR+5,%dx
00223 us_waitit:
00224 in   %dx,%al
00225 test $0x20,%al
00226 jz   us_waitit
00227 mov  UART_BASEADDR,%dx
00228 xchg %al,%ah
00229 out  %al,%dx            // output char
00230 
00231 cmp  $0x78,%al
00232 jz   readit
00233 cmp  $0x0D,%al      //CR
00234 jnz  evalchar
00235 mov  $0x0A,%ah
00236 jmp  sendchar
00237 
00238 evalchar:
00239 cmp  $0x20,%al        //space
00240 jz   gosub
00241 cmp  $0x0A,%al      //CR
00242 jz   gosub
00243 cmp  $0x08,%al      //BS
00244 jnz  processchar
00245 //subit:
00246 shr  $0x04,resultreg
00247 jmp  readit
00248 processchar:
00249 cmp  $0x3A,%al
00250 jl   subnum
00251 cmp  $0x47,%al
00252 jl   subcaps 
00253 //sublc:
00254 sub  $0x57,%al
00255 jmp  additupn
00256 subcaps:
00257 sub  $0x37,%al
00258 jmp  additupn
00259 subnum:
00260 sub  $0x30,%al
00261 additupn:
00262 shl  $0x04,resultreg
00263 and  $0xf,%eax
00264 add  %eax,resultreg
00265 jmp  readit
00266 
00267 gosub:
00268 jmp  *subroutinereg
00269 
00270 //intersubcall
00271 // eax,edx,esi,edi
00272 
00273 // ebx,ecx,ebp,esp(?)
00274 // ds,es,fs,gs
00275 
00276 dotest:
00277 mov $ramtest,resultreg
00278 mov $test1a,subroutinereg
00279 jmp displayhex
00280 test1a:
00281 mov $welcome,resultreg
00282 mov $readcommand,subroutinereg
00283 jmp displayhex
00284 
00285 dodmem:
00286 
00287 movl $dmem1a, subroutinereg
00288 jmp  readnibbles
00289 dmem1a:
00290 mov  resultreg,%ebx    // address
00291 movl $dmem1b, subroutinereg
00292 jmp  readnibbles
00293 dmem1b:
00294 mov  resultreg,%ecx    // length
00295 
00296 dmemloop:
00297 mov %ebx,resultreg
00298 mov $daddr1,subroutinereg
00299 jmp displayhex
00300 daddr1:
00301 mov $spaces,resultreg
00302 mov $startshowm,subroutinereg
00303 jmp displaystring
00304 
00305 startshowm:
00306 mov (%ebx),resultreg
00307 mov $showm1,subroutinereg
00308 jmp displayhexlinear
00309 showm1:
00310 add $0x04,%ebx
00311 mov (%ebx),resultreg
00312 mov $showm2,subroutinereg
00313 jmp displayhexlinear
00314 showm2:
00315 add $0x04,%ebx
00316 mov (%ebx),resultreg
00317 mov $showm3,subroutinereg
00318 jmp displayhexlinear
00319 showm3:
00320 add $0x04,%ebx
00321 mov (%ebx),resultreg
00322 mov $showa0,subroutinereg
00323 jmp displayhexlinear
00324 
00325 showa0:
00326 sub $0xC,%ebx
00327 mov (%ebx),resultreg
00328 mov $showa1,subroutinereg
00329 jmp displayasciilinear
00330 showa1:
00331 add $0x04,%ebx
00332 mov (%ebx),resultreg
00333 mov $showa2,subroutinereg
00334 jmp displayasciilinear
00335 showa2:
00336 add $0x04,%ebx
00337 mov (%ebx),resultreg
00338 mov $showa3,subroutinereg
00339 jmp displayasciilinear
00340 showa3:
00341 add $0x04,%ebx
00342 mov (%ebx),resultreg
00343 mov $doneshow,subroutinereg
00344 jmp displayasciilinear
00345 doneshow:
00346 mov $cr,resultreg
00347 mov $doneshow1,subroutinereg
00348 jmp displaystring
00349 doneshow1:
00350 dec %cx
00351 cmp $0x0,%cx
00352 jz  exitdmem 
00353 add $0x04,%ebx
00354 jmp dmemloop
00355 exitdmem:
00356 jmp readcommand
00357 
00358 dooutb:
00359 // out val,port
00360 movl $outb1a, subroutinereg
00361 jmp  readnibbles
00362 outb1a:
00363 mov  resultreg,%ebx
00364 movl $outb1b, subroutinereg
00365 jmp  readnibbles
00366 outb1b:
00367 mov  resultreg,%edx
00368 mov  %ebx,%eax
00369 out  %al,%dx
00370 jmp  readcommand
00371 
00372 dooutw:
00373 // out val,port
00374 movl $outw1a, subroutinereg
00375 jmp  readnibbles
00376 outw1a:
00377 mov  resultreg,%ebx
00378 movl $outw1b, subroutinereg
00379 jmp  readnibbles
00380 outw1b:
00381 mov  resultreg,%edx
00382 mov  %ebx,%eax
00383 out  %ax,%dx
00384 jmp  readcommand
00385 
00386 dooutd:
00387 // out val,port
00388 movl $outd1a, subroutinereg
00389 jmp  readnibbles
00390 outd1a:
00391 mov  resultreg,%ebx
00392 movl $outd1b, subroutinereg
00393 jmp  readnibbles
00394 outd1b:
00395 mov  resultreg,%edx
00396 mov  %ebx,%eax
00397 out  %eax,%dx
00398 jmp  readcommand
00399 
00400 wmemb:
00401 movl $wmemba, subroutinereg
00402 jmp  readnibbles
00403 wmemba:
00404 mov  resultreg,%ebx
00405 movl $wmembb, subroutinereg
00406 jmp  readnibbles
00407 wmembb:
00408 mov  resultreg,%eax
00409 mov  %al,(%ebx)
00410 jmp  readcommand
00411 
00412 wmemw:
00413 movl $wmemwa, subroutinereg
00414 jmp  readnibbles
00415 wmemwa:
00416 mov  resultreg,%ebx
00417 movl $wmemwb, subroutinereg
00418 jmp  readnibbles
00419 wmemwb:
00420 mov  resultreg,%eax
00421 mov  %ax,(%ebx)
00422 jmp  readcommand
00423 
00424 wmeml:
00425 movl $wmemla, subroutinereg
00426 jmp  readnibbles
00427 wmemla:
00428 mov  resultreg,%ebx
00429 movl $wmemlb, subroutinereg
00430 jmp  readnibbles
00431 wmemlb:
00432 mov  resultreg,%eax
00433 mov  %eax,(%ebx)
00434 jmp  readcommand
00435 
00436 doinb:
00437 // in port
00438 movl $inb1a, subroutinereg
00439 jmp  readnibbles
00440 inb1a:
00441 mov  resultreg,%edx
00442 mov  $0x0,%eax
00443 in   %dx,%al
00444 mov  %eax,resultreg
00445 mov  $readcommand,subroutinereg
00446 jmp  displayhex
00447 
00448 doinw:
00449 // in port
00450 movl $inw1a, subroutinereg
00451 jmp  readnibbles
00452 inw1a:
00453 mov  resultreg,%edx
00454 mov  $0x0,%eax
00455 in   %dx,%ax
00456 mov  %eax,resultreg
00457 mov  $readcommand,subroutinereg
00458 jmp  displayhex
00459 
00460 doind:
00461 // in port
00462 movl $ind1a, subroutinereg
00463 jmp  readnibbles
00464 ind1a:
00465 mov  resultreg,%edx
00466 in   %dx,%eax
00467 mov  %eax,resultreg
00468 mov  $readcommand,subroutinereg
00469 jmp  displayhex
00470 
00471 jmpto:
00472 movl $jmp1a, subroutinereg
00473 jmp  readnibbles
00474 jmp1a:
00475 mov  $readcommand,%eax
00476 jmp  *resultreg
00477 
00478 callto:
00479 movl $call1a, subroutinereg
00480 jmp  readnibbles
00481 call1a:
00482 mov  $readcommand,%eax
00483 call *resultreg
00484 jmp  readcommand
00485 
00486 dopush:
00487 movl $push1a, subroutinereg
00488 jmp  readnibbles
00489 push1a:
00490 mov  resultreg,%eax
00491 push %eax
00492 jmp  readcommand
00493 
00494 doint:
00495 movl $int1a, subroutinereg
00496 jmp  readnibbles
00497 int1a:
00498 mov  resultreg,%eax
00499 // need to lookup int table? 
00500 // int  %eax
00501 jmp  readcommand
00502 
00503 doenter:
00504 //setup stack frame
00505 
00506 
00507 dopop:
00508 movl $readcommand, subroutinereg
00509 pop  resultreg
00510 jmp  displayhex
00511 
00512 docli:
00513 cli
00514 jmp  readcommand
00515 
00516 dosti:
00517 sti
00518 jmp  readcommand
00519 
00520 
00521 displaystring:
00522 // resultreg= pointer to string terminated by \0
00523 dsloop:
00524 movb  (resultreg),%ah
00525 cmp  $0x0, %ah
00526 jz   displaystringexit
00527 mov  UART_BASEADDR+5,%dx
00528 us_waits:
00529 in   %dx,%al
00530 test $0x20,%al
00531 jz us_waits
00532 mov  UART_BASEADDR,%dx
00533 xchg %al,%ah
00534 out  %al,%dx            // output char
00535 inc  resultreg
00536 jmp  dsloop
00537 displaystringexit:
00538 jmp  *subroutinereg
00539 
00540 displayhexlinear:
00541 mov  resultreg,%eax
00542 xchg %al,%ah     
00543 rol  $0x10,%eax
00544 xchg %al,%ah
00545 mov  %eax,resultreg
00546 displayhex:
00547 rol  $0x10,%ecx
00548 mov  $0x8,%cx
00549 dhloop:
00550 cmp  $0xf,%cl
00551 je   exitdisplayhex
00552 rol  $0x04,resultreg
00553 movl resultreg,%eax
00554 and  $0xf,%al
00555 cmp  $0xa,%al
00556 jl   addnum
00557 //addcaps
00558 add $0x37,%al
00559 jmp  outcharhex
00560 addnum:
00561 add  $0x30,%al
00562 outcharhex:
00563 xchg %al,%ah
00564 mov  UART_BASEADDR+5,%dx
00565 us_waith:
00566 in   %dx,%al
00567 test $0x20,%al
00568 jz us_waith
00569 mov  UART_BASEADDR,%dx
00570 xchg %al,%ah
00571 out  %al,%dx            // output char
00572 dec  %cx
00573 cmp  $0x0,%cx
00574 jne  dhloop
00575 mov  $0x20,%al
00576 mov  $0x10,%cl
00577 jmp  outcharhex
00578 exitdisplayhex:
00579 rol  $0x10,%ecx
00580 jmp  *subroutinereg
00581 
00582 displayasciilinear:
00583 mov  resultreg,%eax
00584 xchg %al,%ah     
00585 rol  $0x10,%eax
00586 xchg %al,%ah
00587 mov  %eax,resultreg
00588 displayascii:
00589 rol  $0x10,%ecx
00590 mov  $0x4,%cx
00591 daloop:
00592 rol  $0x08,resultreg
00593 movl resultreg,%eax
00594 cmp  $0x7e,%al
00595 jg   unprintable
00596 cmp  $0x20,%al
00597 jl   unprintable
00598 jmp  outcharascii
00599 unprintable:
00600 mov  $0x2e,%al          // dot
00601 outcharascii:
00602 xchg %al,%ah
00603 mov  UART_BASEADDR+5,%dx
00604 us_waita:
00605 in   %dx,%al
00606 test $0x20,%al
00607 jz us_waita
00608 mov  UART_BASEADDR,%dx
00609 xchg %al,%ah
00610 out  %al,%dx            // output char
00611 dec  %cx
00612 cmp  $0x0,%cx
00613 jne  daloop
00614 rol  $0x10,%ecx
00615 jmp  *subroutinereg
00616 
00617 rst:
00618 cli
00619 movb $0x0fe,%al
00620 out  %al,$0x64
00621 hlt
00622 
00623 RST:
00624 cli
00625 lidt %cs:0x03fff
00626 int  $0x3
00627 hlt
00628 
00629 
00630 beep:
00631 mov  timertime,%eax
00632 rol  $0x10,%eax
00633 mov  $0xb6,%al
00634 out  %al,$0x43
00635 mov  freqtime,%ax
00636 out  %al,$0x42
00637 xchg %al,%ah
00638 out  %al,$0x42
00639 
00640 in   $0x61,%al
00641 or   $0x03,%al
00642 out  %al,$0x61
00643 
00644 //timer here
00645 timer:
00646 in   $0x42,%al
00647 // xchg %al,%ah
00648 in   $0x42,%al
00649 // xchg %al,%ah
00650 cmp  $0x0,%al
00651 jnz  timer
00652 rol  $0x10,%eax
00653 dec  %ax
00654 cmp  $0x0,%ax;
00655 rol  $0x10,%eax
00656 jnz  timer
00657 // timer
00658 
00659 in   $0x61,%al
00660 and  $0xfc,%al
00661 out  %al,$0x61
00662 jmp  *subroutinereg
00663 
00664 dohelp:
00665 mov $cmds,resultreg
00666 mov $readcommand,subroutinereg
00667 jmp displaystring
00668 
00669 memt:
00670 movl $memt1, subroutinereg
00671 jmp  readnibbles
00672 memt1:
00673 mov  resultreg,%ecx
00674 movl $memt2, subroutinereg
00675 jmp  readnibbles
00676 memt2:
00677 mov  resultreg,%ebx
00678 xchg %ecx,%eax
00679 mov  $readcommand,%esp   // internal to linux bios
00680 jmp ramtest
00681 
00682 pcirb:
00683 movl $pcirb1, subroutinereg
00684 jmp  readnibbles
00685 pcirb1:
00686 mov  resultreg,%eax
00687 PCI_READ_CONFIG_BYTE
00688 and  $0xff,%eax
00689 mov  %eax,resultreg
00690 mov  $readcommand,subroutinereg
00691 jmp  displayhex
00692 
00693 pcirw:
00694 movl $pcirw1, subroutinereg
00695 jmp  readnibbles
00696 pcirw1:
00697 mov  resultreg,%eax
00698 PCI_READ_CONFIG_WORD
00699 and  $0xffff,%eax
00700 mov  %eax,resultreg
00701 mov  $readcommand,subroutinereg
00702 jmp  displayhex
00703 
00704 pcirl:
00705 movl $pcirl1, subroutinereg
00706 jmp  readnibbles
00707 pcirl1:
00708 mov  resultreg,%eax
00709 PCI_READ_CONFIG_DWORD
00710 mov  %eax,resultreg
00711 mov  $readcommand,subroutinereg
00712 jmp  displayhex
00713 
00714 
00715 
00716 
00717 pciwb:
00718 movl $pciwb1, subroutinereg
00719 jmp  readnibbles
00720 pciwb1:
00721 mov  resultreg,%ebx
00722 movl $pciwb2, subroutinereg
00723 jmp  readnibbles
00724 pciwb2:
00725 mov  resultreg,%edx
00726 mov  %ebx,%eax
00727 PCI_WRITE_CONFIG_BYTE
00728 jmp  readcommand
00729 
00730 pciww:
00731 movl $pciww1, subroutinereg
00732 jmp  readnibbles
00733 pciww1:
00734 mov  resultreg,%ebx
00735 movl $pciww2, subroutinereg
00736 jmp  readnibbles
00737 pciww2:
00738 mov  resultreg,%ecx
00739 mov  %ebx,%eax
00740 PCI_WRITE_CONFIG_WORD
00741 jmp  readcommand
00742 
00743 pciwl:
00744 movl $pciwl1, subroutinereg
00745 jmp  readnibbles
00746 pciwl1:
00747 mov  resultreg,%ebx
00748 movl $pciwl2, subroutinereg
00749 jmp  readnibbles
00750 pciwl2:
00751 mov  resultreg,%ecx
00752 mov  %ebx,%eax
00753 PCI_WRITE_CONFIG_DWORD
00754 jmp  readcommand
00755 
00756 cram:
00757 //likely not working.  Just testing for now
00758 movl $cram1, subroutinereg
00759 jmp  readnibbles
00760 cram1:
00761 mov resultreg,%ebx
00762 movl $cram1, subroutinereg
00763 jmp  readnibbles
00764 cram2:
00765 mov resultreg,%ecx
00766 // enable it
00767 mov %cr0,%eax
00768 and $0x9fffffff,%eax  // also try 0x0fff, 0x2ff(write back)...
00769 mov %eax,%cr0
00770 //wbinvd ??
00771 cacheloop:
00772 mov (%ebx),%eax
00773 inc %ebx
00774 loop cacheloop
00775 // disable it
00776 mov %cr0,%eax
00777 or  $0x60000000,%eax
00778 mov %eax,%cr0
00779 //wbinvd ??
00780 
00781 dodl:
00782 movl $dl1, subroutinereg
00783 jmp  readnibbles
00784 dl1:
00785 mov  resultreg,%ebx
00786 movl $dl2, subroutinereg
00787 jmp  readnibbles
00788 dl2:
00789 mov  resultreg,%ecx
00790 mov  resultreg,subroutinereg
00791 mov  %ebx,resultreg
00792 dlloop:
00793 mov  UART_BASEADDR+5,%dx
00794 in   %dx, %al
00795 and  $0x9f,%al
00796 test $0x01,%al
00797 jz   dlloop
00798 mov  UART_BASEADDR,%dx
00799 in   %dx,%al
00800 mov  %al,(%ebx)
00801 inc  %ebx
00802 loop dlloop
00803 csum:
00804 mov subroutinereg,%ecx
00805 shr $0x02,%ecx
00806 mov resultreg,%ebx
00807 mov $0x0,%eax
00808 csumloop:
00809 rol $0x03,%eax
00810 mov (%ebx),%dl
00811 xor  %dl,%al
00812 inc  %ebx
00813 loop csumloop
00814 mov $readcommand,subroutinereg
00815 mov %eax,resultreg
00816 jmp displayhex
00817 
00818 baud:
00819 mov $sorry,resultreg
00820 mov $readcommand,subroutinereg
00821 jmp displaystring
00822 
00823 mcp:
00824 movl $mcp1, subroutinereg
00825 jmp  readnibbles
00826 mcp1:
00827 mov  resultreg,%ebx
00828 movl $mcp2, subroutinereg
00829 jmp  readnibbles
00830 mcp2:
00831 mov  resultreg,%ecx
00832 movl $mcp3, subroutinereg
00833 jmp  readnibbles
00834 mcp3:
00835 mov  resultreg,%eax
00836 xchg %ecx,%eax
00837 mcploop:
00838 mov  (%ebx),%dl
00839 mov  %dl,(%eax)
00840 inc  %ebx
00841 inc  %eax
00842 loop mcploop
00843 jmp  readcommand
00844 
00845 dopattern:
00846 movl $pat1, subroutinereg
00847 jmp  readnibbles
00848 pat1:
00849 mov  resultreg,%ebx
00850 movl $pat2, subroutinereg
00851 jmp  readnibbles
00852 pat2:
00853 mov  resultreg,%ecx
00854 movl $pat3, subroutinereg
00855 jmp  readnibbles
00856 pat3:
00857 mov  resultreg,%eax
00858 xchg %ecx,%eax
00859 patloop:
00860 rol $0x08,%ebx
00861 mov %bl,(%eax)
00862 inc %eax
00863 loop patloop
00864 jmp readcommand
00865 
00866 
00867 doexit:
00868          // LB specific:
00869 RETSP    // if there's no stack yet, caller must set %esp manually
00870 // RET_LABEL(low_level_shell)
00871 
00872 
00873 //Linux OS Specific
00874 ioperms:
00875 movl    $sys_IOPL, %eax         # system-call ID-number
00876 movl    $3, %ebx                # new value for IO0PL
00877 int     $0x80                   # enter the kernel
00878 ret
00879 
00880 llshell_out:

Generated on Wed Jan 7 14:14:21 2009 for coreboot by  doxygen 1.5.5