here is my code:
Code:
/*all i get is random ascii chars*/
#define MK_FP( seg,ofs )( (void _seg * )( seg ) +( void near * )( ofs ))
#define FP_SEG( fp )( (unsigned )( void _seg * )( void far * )( fp ))
#define FP_OFF( fp )( (unsigned )( fp ))
struct __string { //structure returned by qurey filesystem call
char far str[75];
};
void output(char far *s){
do {
_SI = 1; //Function 1 (putchar)
_AH = *s; //AH = char
asm {int 0x32}; //My Os interrupt is 32h
} while(*s++);
}
void main(){
__string far *s; //only need a pointer
_SI = 16; //function 16 (qurey filesystem)
asm {int 0x32}; //Returns: bx = # files es:di = pointer to __string struct full of filenames
int c = _BX; //Get number of files
s = (__string far *)MK_FP(_ES, _DI); //get filenames
for(int j = 0;j < c && j < 255;j++){
output(s[j].str); //loop through the files displaying them
output("\r\n");
}
}
and dont bother looking at the kernel source in general because this uses
the new interrupt call system that is not yet update online yet