Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

A com loader

Hey, I need to write a com loader with the bois ints. I have tried to do it on my own, but I can't get it. Can someone help me? I am using NASM




Comments

  • get a copy of the dos/win loader from the boot

    sector using norton diskedit and use debug to

    convert the machine code into assembler.



    then you can see how a loader works.

    ooops.

    *COM* loader ? you mean loading a com program into memory ?

    try using the EXEC interrupt in DOS.



    hope this helps





    bikram


  • : get a copy of the dos/win loader from the boot

    : sector using norton diskedit and use debug to

    : convert the machine code into assembler.

    :

    : then you can see how a loader works.

    : ooops.

    : *COM* loader ? you mean loading a com program into memory ?

    : try using the EXEC interrupt in DOS.

    :

    : hope this helps

    :

    :

    : bikram

    :

    Well, I don't have norton disk editro or I would try that. I don't want to use the EXEC command, because I am using the bois ints. Isn't there any code on the net that I could look at?






  • Why not get a copy of Linux source code ?

    It will have a similar sort of loader...plus MANY other goodies !!



    You could buy a book called Red Hat Linux Bible that comes with 2 CDROMS and is published by IDG Books. It also has Linux source code in it.



    ciao.

    Bikram


  • : Why not get a copy of Linux source code ?

    : It will have a similar sort of loader...plus MANY other goodies !!

    :

    : You could buy a book called Red Hat Linux Bible that comes with 2 CDROMS and is published by IDG Books. It also has Linux source code in it.

    :

    : ciao.

    : Bikram

    :

    I have looked a the linux source, and it is no help. I has so much code on what to do if it fails that I can't follow it. Besides it doesn't load com files.








  • : Why not get a copy of Linux source code ?

    : It will have a similar sort of loader...plus MANY other goodies !!

    :

    : You could buy a book called Red Hat Linux Bible that comes with 2 CDROMS and is published by IDG Books. It also has Linux source code in it.

    :

    : ciao.

    : Bikram

    :

    I have looked a the linux source, and it is no help. I has so much code on what to do if it fails that I can't follow it. Besides it doesn't load com files.








  • an old? book i found...so lemme go through it and see if i can find what you are looking for.

    when i do find it i will post a new message on this board.



    ciao.

    Bikram


  • ok I'm going to assume you can find the cylinder head and sector that the file begins in. (If not just post away)



    Once you know that just use INT 13h AH=02 (or maybe a different INT depending on what device you are loading the file from)

    mov ah, 02

    mov al, 128 ;# of sectors 128*512=65536 (or you could load the size of the file)

    mov ch, low 8 bits of cyl

    mov cl, sector # + high 2 bits of cyl(7-6)

    mov dh, head #

    mov dl, drive #

    mov bx, 0x100 ;points to 100h beginning of where you'll put COM file

    mov es, segment of where you'll put COM file

    int 13h

    After you load this you initialize the PSP (Program Segment Prefix)



    The Art of Assembly goes over the format of this and I'm sure you can find information for it.



    Then just do a far call or far jmp to SEGMENT:100h and you're done


  • : ok I'm going to assume you can find the cylinder head and sector that the file begins in. (If not just post away)

    :

    : Once you know that just use INT 13h AH=02 (or maybe a different INT depending on what device you are loading the file from)

    : mov ah, 02

    : mov al, 128 ;# of sectors 128*512=65536 (or you could load the size of the file)

    : mov ch, low 8 bits of cyl

    : mov cl, sector # + high 2 bits of cyl(7-6)

    : mov dh, head #

    : mov dl, drive #

    : mov bx, 0x100 ;points to 100h beginning of where you'll put COM file

    : mov es, segment of where you'll put COM file

    : int 13h

    : After you load this you initialize the PSP (Program Segment Prefix)

    :

    : The Art of Assembly goes over the format of this and I'm sure you can find information for it.

    :

    : Then just do a far call or far jmp to SEGMENT:100h and you're done

    :



    ok, first how do i start the PSP? Then what does SEGMENT:100h mean?

    I know what 100h. How could I find the segment?






Sign In or Register to comment.