Reading File From Memory
Posted: Mon Jan 13, 2003 4:15 pm
I wanted to read some files from memory before I write a floppy driver.
I got grub to load a text file for me, it loads it at 0x106000, and tells me it is 0x2c bytes in size.
This code doesn't work, but by reading beyond 0x2c, I discovered that the text in the file is actually located at 0x107000.
Why is this?
It's a regular text file created with TextPad, no header information (as far as i know!), I've tested with both DOS ASCII format and ANSI, both produce the same.
-EDIT: How do you detect EOF?
I got grub to load a text file for me, it loads it at 0x106000, and tells me it is 0x2c bytes in size.
Code: Select all
unsigned char *mem ;
char c ;
unsigned int i ;
for(i=0; i<0x2c; i++)
{
mem = (unsigned char *)0x106000 ;
c = mem[i] ;
std::cout.put(c) ;
}Why is this?
It's a regular text file created with TextPad, no header information (as far as i know!), I've tested with both DOS ASCII format and ANSI, both produce the same.
-EDIT: How do you detect EOF?