Voir la version complète : How to modify memtest86+ to ...
Dear all ,
How to modify memtest86+ to read a file ?
I can compiler memtset86 , and include "stdio.h" & "stdlib.h"
but it's seem uncompatible with memtest86+ .
the error message :
init.c : (.text+0x565):undefine reference to "fopen" .:blink:
ps . i put new program to init.c ..
thank's
Wichetael
24/11/2008, 14h03
This is not possible without a huge amount of effort. Memtest does not run inside of an OS, hence there is no standard library, thus no functions from stdio.h or stdlib.h will work. You would have to implement the functionality you wish from the standard library yourself, but also the functionality provided by the OS to realise the functionality of the standard library. All in all, not really something you will want to be doing.
First of all , Thank's for your response .^_^
now i have three selection for this problem .
PS .( i running memtest86+ in pure dos 6.22 environment , use memtest.exe file .)
1 . exit the memtest86+ program , then i can write/read any file in pure
dos environment , my thought is exit memtest86+ program , first i need
to exit protect mode , then use " movw 0x4c,ah " , " int 0x21 " , to exit
the program , i try it , but it didn't work .
2 . use the standard library to open/close file , but it still didn't work :|
3 . after running memtest86+ , i try to open another porgram , that
program can read/write file , but i am not try it yet , and i will try it
:p .
in the meantime , i will still trying all the possibility selection that i thought .
thank's
Well, you need to understand that there is NO pure dos environment in Memtest86+. There is no dos, nor linux AT ALL. Memtest86+ could be seen as an Operating System by itself. When you use memtest.exe, the binary just flush the ENTIRE memory and load itself. There is no trace of the old operating system remaining after that.
Wichetael
25/11/2008, 16h28
When running memtest.exe from DOS, DOS can be seen as a boot loader for memtest, just like you can load linux from DOS with loadlin. Nothing of DOS remains when you start memtest, so you can't make int 21h calls, nor can you exit back to DOS. The only thing you can do is interface with the BIOS or directly with the hardware. This also means that you will have to interpret and update any filesystem data structures yourself. This is really just way too much effort for what it's going to give you.
So a doable workaround if you only need read-only access would be to incbin your file at a known address in the MemTest binary (don't know if this would solve your problem).
For read-only access, it may work. And if you need to write some bits, just use unused CMOS bytes.
Thank's for your response and opinion .
will , i think i must to give up my selection 1 & 3 , and working hard to make selection 2 come true , and i believe it will makes me a lot of time :blink:( in fact , i am already try it a lot of days ) .
am i must to creat new library to access file ?
because they are seems incompatible ..
i copy some description fopen() from stdio.h and put it in test.h ( memtest86+ lib) but it still not working ..
i will continuum to try it ..
Thank's
To use functions like fopen, you need tons of libraries in order to handle a file system (FAT). Every functions on stdio.h relies on the operating system for basic I/O access. There is no operating system on Memtest, so you basically need to write the entire operating system by yourself.
Good luck.
Hi ~ Doc TB .
How about use bios interrupt to read/write file ?
i know some motherboard ( like gigabyte ) , they can
access floppy in bios ( for read new bios file and update )
so .. i think maybe i can use bios interrupt to realize this
function .
i will looking for some information about bios interrupt .
anyway , thank's for your response ^_^
if i have any new idea , i am very glad to discussed with U ..^_^
There is no BIOS interrupt to read or write a file. BIOS interrupts are only used for really low-level task and nothing more. BIOS that can access files on floppy includes all the code to handle a file system, and it's a lot of code.
vBulletin® v.3.8.4, Copyright ©2000-2010, Jelsoft Enterprises Ltd. Tous droits réservés - Version française vbulletin-fr.org