[U-Boot] fopen/fwrite functions

Hi, experts: Could i use fopen/fwrite standard C lib functions in U-boot code?
Best wishes,

Dear TigerLiu@viatech.com.cn,
In message FE7ADED5C2218B4786C09CD97DC4C49F8DB38A@exchbj02.viatech.com.bj you wrote:
Could i use fopen/fwrite standard C lib functions in U-boot code?
What for? We do not even have a concept of files in U-Boot...
Best regards,
Wolfgang Denk

Dear Denk: U-boot supports FAT file system. So, i want to read/write a file in USB disk (formatted with fat file system). So, could i use fopen/fwrite functions?
Best wishes,
-----邮件原件----- 发件人: Wolfgang Denk [mailto:wd@denx.de] 发送时间: 2013年5月30日 15:50 收件人: Tiger Liu 抄送: u-boot@lists.denx.de 主题: Re: [U-Boot] fopen/fwrite functions
Dear TigerLiu@viatech.com.cn,
In message FE7ADED5C2218B4786C09CD97DC4C49F8DB38A@exchbj02.viatech.com.bj you wrote:
Could i use fopen/fwrite standard C lib functions in U-boot code?
What for? We do not even have a concept of files in U-Boot...
Best regards,
Wolfgang Denk

Dear TigerLiu@viatech.com.cn,
please do not top post / full quote. See [1] if you need help.
[1] http://www.netmeister.org/news/learn2quote.html
In message FE7ADED5C2218B4786C09CD97DC4C49F8DB429@exchbj02.viatech.com.bj you wrote:
U-boot supports FAT file system.
Yes, it does. And it supports commands to access these.
So, i want to read/write a file in USB disk (formatted with fat file system). So, could i use fopen/fwrite functions?
No, you cannot.
As I mentioned before: We do not even have a concept of files in U-Boot. Operations like fopen/fwrite make only sense when you always have an underlying file system (like the root file system in Unix systems). We don't have that, and so we have no functions like fopen() or open() etc.
To read a file from a FAT file system, you have to use the file system specific access code, in this case do_fat_fsload() resp. do_load()
Best regards,
Wolfgang Denk

Dear Denk: Got it! Thank you!
Best wishes,

Hi, experts: I wrote a driver for uboot. This driver called writel/readl function. I have included "include/asm/io.h".
But when i compiled , it output below error msgs: undefined reference to `__readwrite_bug'
Best wishes,
participants (2)
-
TigerLiu@viatech.com.cn
-
Wolfgang Denk