ide driver code - success
Peter Mueller
peter.o.mueller at gmx.de
Wed Aug 28 00:01:04 UTC 2002
Hi all,
I'm currently using the ide driver from Thomas to access an IDE drive from my 68332 CPU. So far everthing seems to be fine. I have managed to read out the directory of hda1. Unfortunately this works only with a very small C program. If I build a bigger application the following occures:
I already had a strange effect while adapting the driver code to my system. In the ide code there is a routine loading the MBR to check whether there is a valid partition available etc. Therefore a buffer of 512 bytes is required. In the original code from Thomas this looks like:
....
rtems_unsigned8 data[SECTOR_DATA_SIZE];
....
if(read_block(hd, SECTOR_MBR, (rtems_unsigned16 *)data, SECTOR_DATA_SIZE) == 0)
This looks ok but "data" was always corrupt (seems to point in the code area). I changed the code then to
rtems_unsigned16 *data;
...
data = malloc(512);
if(read_block(hd, SECTOR_MBR, data, SECTOR_DATA_SIZE) == 0){
This has worked for my small C test programm bug fails if I have a bigger application. In my opinion both should work. In the bigger application the debugger (ddd) does not even show me "data". Gdb says the symbol is not available. I assume this indicates that I have a problem with my stack ...
I'm not sure if the problem is really related to applicatio size. Any idea how to tackle the problem? Can I use malloc in this early stage of OS initialization? How can I find out the amount of stack, data etc. is available for the OS and application during OS boot?
Any hints welcome,
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20020828/75972a69/attachment.bin>
More information about the users
mailing list