Click here to Skip to main content
16,020,840 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.
i followed this instruction to build my bootloader:
http://www.codeproject.com/Articles/28067/Boot-Into-Your-Own-Hello-World-Application

but the thing i want to do is that in the bootloader i want to list(show) the files and the folders in my C drive(or any other drive)(without any menu or user input just show)

i searched a lot and found that one of the bios intrrupts(0x13) can help me do this but because i'm not really familiar with the assembly language i'm stuck now.

is anyone know how to do this so he can help about it?

thanks
this is my code so far(notice that it only shows a little message on the screen not what i want,i want to change it):
ASM
;**************************************************
; Hello World OS Boot loader
; Designed by Arnav
; http://pendorasoft.byethost15.com/
;**************************************************

[BITS 16] [ORG 0x0000] 
; code located at 0000:7C00, adjust segment registers
          cli
          mov     ax, 0x07C0
          mov     ds, ax
          mov     es, ax
          mov     fs, ax
          mov     gs, ax

; create stack
          mov     ax, 0x0000
          mov     ss, ax
          mov     sp, 0xFFFF
          sti

; post message
          mov     si,msgHello
          call    DisplayMessage
          mov     si, msgEnd
          call    DisplayMessage
          hlt


; Display Message
DisplayMessage:
          lodsb                                       ; load next character
          or      al, al                              ; test for NUL character
          jz      .DONE
          mov     ah, 0x0E                            ; BIOS teletype
          mov     bh, 0x00                            ; display page 0
          mov     bl, 0x07                            ; text attribute
          int     0x10                                ; invoke BIOS
          jmp     DisplayMessage
     .DONE:
          ret

; data section
msgHello  db 0x0D, 0x0A, "Hello World", 0x0D, 0x0A, 0x00
msgEnd  db 0x0D, 0x0A, "That's all folks!!!", 0x0D, 0x0A, 0x00

;ASM Signature
          TIMES 510-($-$$) DB 0
          DW 0xAA55
Posted
Comments
[no name] 14-Feb-14 23:13pm    
Why are you doing this exercise? If it is to learn assembly programming then make an attempt and you will be helped. There is a lot of work to get from 1nt13h to read a directory without DOS. At the moment you have posted another persons code and asked us to add to it.
Saeedek 15-Feb-14 0:36am    
yes i want to learn.but i want to have some beginning points.
where should i start? do i need to write a loop?

1 solution

You can't do that since the bios interrupts do not handle FAT or NTFS tables, but only allow you access to the raw disk sectors, as described in http://en.wikipedia.org/wiki/INT_13H[^]. And if you do not know detailed assembler programming it is unlikely that you would be able to write such an application.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900