x86 Assembly

Moderators: None (Apply to moderate this forum)
Number of threads: 4556
Number of posts: 16011

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
how to copy interrupt vector table to floppy Posted by kwdogg454 on 9 Oct 2002 at 8:22 PM
This message was edited by kwdogg454 at 2002-10-10 2:46:55

This message was edited by kwdogg454 at 2002-10-9 21:20:56

hello fellow asm programers,
i am beginning to learn asm and am working on a project that i found rather interesting. its a start of writing a basic OS on a floppy. i am hung up in this way: i need to find a way to write the flags register and the interrupt vector table to the 2nd and 3rd sectors on a floppy respectively. the code i am writing is stored on the 1rst sector of the floppy. upon boot up the disk will halt the boot up process before any OS is loaded ( this part is done)so i need to use BIOS interrupts not DOS to get the information from the register and IVT at this point and copy it back to the disk. im assuming i need to use int 13h but im lost at this point. if anyone has done this before and/or can help i would greatly appreciate it. thanks!!! i am using MASM by the way





Report
Re: how to copy interrupt vector table to floppy Posted by ajtr211 on 10 Oct 2002 at 3:59 AM
This message was edited by ajtr211 at 2002-10-10 8:18:58

This message was edited by ajtr211 at 2002-10-10 8:16:38

: This message was edited by kwdogg454 at 2002-10-10 2:46:55

: This message was edited by kwdogg454 at 2002-10-9 21:20:56

: hello fellow asm programers,
: i am beginning to learn asm and am working on a project that i found rather interesting. its a start of writing a basic OS on a floppy. i am hung up in this way: i need to find a way to write the flags register and the interrupt vector table to the 2nd and 3rd sectors on a floppy respectively. the code i am writing is stored on the 1rst sector of the floppy. upon boot up the disk will halt the boot up process before any OS is loaded ( this part is done)so i need to use BIOS interrupts not DOS to get the information from the register and IVT at this point and copy it back to the disk. im assuming i need to use int 13h but im lost at this point. if anyone has done this before and/or can help i would greatly appreciate it. thanks!!! i am using MASM by the way
:
************************************************************************
Hi, Greetings,

This is a register dumper procedure
.data
array DWORD 1,2,3,4,5,6,7,8,9,0Ah,0Bh
.code
main proc
mov esi,OFFSET array ;starting offset
mov ecx,Lengthof array ;number of units
mov ebx,Type array ;doubleword format
call DumpMemory

exit ;Invoke exit procedure [ do this yourself]
;mov ah,20h,int 21h or mov ax,4c00h,int 21h
main endp

DumpMemory proc
.data
flags WORD ?
saveIP WORD ?
saveSP WORD ?
.code pop saveIP
mov saveSP,sp
push saveIP
push eax
pushfd
pushf
pop flags

NewLine
ShowRegister EAX,EAX
ShowRegister EBX,EBX
ShowRegister ECX,ECX
ShowRegister EDX,EDX
NewLine
ShowRegister ESI,ESI
ShowRegister EDI,EDI

ShowRegister EBP,EBP

movzx eax,saveSP
ShowRegister ESP,EAX
NewLine

movzx eax,saveIP
ShowRegister EIP,EAX

movzx eax,flags
ShowRegister EFL,EAX
;Show the flags
ShowFlag CF,1
ShowFlag SF,8
ShowFlag ZF,7
ShowFlag OF,12

NewLine
NewLine

popfd
pop eax
ret
DumpMemory endp
END MAIN

OUTPUT:
00000001 00000002 00000003 00000004 00000005 00000006
00000007 00000008 00000009 0000000A 0000000B

WHEN YOU USE THE DUMPMEMORY IN OTHER CODE IT
WILL SHOW:EXAMPLE OF THE
OUTPUT:

EAX=00000613 EBX=00000000 ECX=000000FF EDX=00000065
ESI=00000001 EDI=00000054 EBP=0000065F ESP=00000076
EIP= 0041206 EFL-00000032 CF=0 SF=1 ZF=0 OF=0

Your own code will be different from this.
Regards AJTR211








Report
Re: how to copy interrupt vector table to floppy Posted by jeffleyda on 10 Oct 2002 at 8:14 AM
floppy. i am hung up in this way: i need to find a way to write the flags register and the interrupt vector table to the 2nd and 3rd sectors on a floppy respectively. the code i am writing is stored on

got just the thing for ya:

http://www.oldskool.org/pc/flopper

The full source for flopper is included in the zipfile available there.
Inside you'll find a file called "install.asm" which is a stand alone program which modifies a boot sector on a floppy to save the vector table to a couple sectors on the floppy. (I dont recall where exactly I save it, I think at the end of the disk so it doesn't destroy DOS info)
Anyway, once the vector table has been saved to floppy, you can then use install again to retrieve the data and save it to a file.

The program is written in masm and should be commented enough to get you through your project. If not, contact me (contact info is included in the flopper documentation) and I'll be glad to help out.

-jeff!





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.