[ Pobierz całość w formacie PDF ]
.message 2e =.mov bx, #7int 0x10popamov dx,trackmov cx,sreadinc cxmov ch,dlmov dx,headmov dh,dland dx,#0x0100mov ah,#2push dx ! save for error dumppush cxpush bxpush axint 0x13jc bad_rtadd sp, #8poparetbad_rt: push ax ! save error codecall print_all ! ah = error, al = readxor ah,ahxor dl,dlint 0x13add sp, #10popajmp read_track/** print_all is for debugging purposes.* It will print out all of the registers.The assumption is that this is* called from a routine, with a stack frame like* dx* cx* bx* ax* error* ret <- sp**/print_all:mov cx, #5 ! error code + 4 registersmov bp, spprint_loop:push cx ! save count leftcall print_nl ! nl for readabilitycmp cl, #5jae no_reg ! see if register name is neededmov ax, #0xe05 + 'A - 1sub al, clint 0x10mov al, #'Xint 0x10mov al, #':int 0x10no_reg:add bp, #2 ! next registercall print_hex ! print itpop cxloop print_loopretprint_nl:mov ax, #0xe0d ! CRint 0x10mov al, #0xa ! LFint 0x10ret/** print_hex is for debugging purposes, and prints the word* pointed to by ss:bp in hexadecimal.*/print_hex:mov cx, #4 ! 4 hex digitsmov dx, (bp) ! load word into dxprint_digit:rol dx, #4 ! rotate so that lowest 4 bits are usedmov ax, #0xe0f ! ah = request, al = mask for nybbleand al, dladd al, #0x90 ! convert al to ascii hex (four instructions)daaadc al, #0x40daaint 0x10loop print_digitret/** This procedure turns off the floppy drive motor, so* that we enter the kernel in a known state, and* don't have to worry about it later.*/kill_motor:push dxmov dx,#0x3f2xor al, aloutbpop dxretsectors:.word 0disksizes:.byte 36,18,15,9msg1:.byte 13,10.ascii "Loading".org 497setup_sects:.byte SETUPSECSroot_flags:.word CONFIG_ROOT_RDONLYsyssize:.word SYSSIZEswap_dev:.word SWAP_DEVram_size:.word RAMDISKvid_mode:.word SVGA_MODEroot_dev:.word ROOT_DEVboot_flag:.word 0xAA55
[ Pobierz całość w formacie PDF ]