⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 printf.htm

📁 mips架构的bootloader,99左右的版本 但源代码现在没人更新了
💻 HTM
字号:
	<title>PMON - printf Call Tree</title>	<h1 align=center>printf Call Tree</h1><!--INDEX "printf Call Tree" -->This page describes what happens when PMON calls printf, or a clientprogram calls printf via the vector table.<p><b>Call Tree</b><pre>   fprintf --\    putchar ------ putc --\             |                          |    printf --+-- vfprintf --+-- fputs --+-- write                            |           |                     puts --/  fwrite --/</pre><dl><dt><b>printf()</b><dd>printf() calls vfprintf() in order to convert the arguments into a listof arguments for use by the macros in varargs.h. It also uses this callto convert the printf(fmt) into fprintf(stdout,fmt).<p><dt><b>vfprintf()</b><dd>vfprintf() calls the common routine vsprintf() which is used for printf(),sprintf(), and fprintf(). This routine places the converted string into abuffer. The buffer is then passed to fputs() for printing.<p><dt><b>fputs()</b><dd>Since PMON does not implement buffered output, fputs() calls write()directly.<p><dt><b>write()</b><dd>write() calls _write(). This indirection is necessary to permit the libraryto be used for both building PMON and building clients.<p><dt><b>_write()</b><dd>Because PMON does not use interrupt driven I/O, it is necessary forPMON to poll the devices frequently looking for newly arrivedcharacters. This is done by calling scandevs(). Having done this _write()then calls _chwrite().<p><dt><b>scandevs()</b><dd>This function scans all devices looking for newly-arrived input.  Itdoes this by calling the driver with OP_RXRDY. If the return statusindicates that a character is ready, it calls with OP_RX to retreivethat actual character. The characters are placed in the input queue viaQput(). Characters that need echoing are sent to the device via_chwrite().<p><dt><b>_chwrite()</b><dd>This function writes a single character to the designated device. Itdoes this by repeatedly calling the driver with OP_TXRDY until ready.It then calls the driver with OP_TX to actually transmit thecharacter.<p></dl></dl><p><hr><b>Navigation:</b> <a href="index.htm">Document Home</a> | <a href="doctoc.htm">Document Contents</a> | <a href="docindex.htm">Document Index</a> <p>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -