调试内核时,因为启动初期串口和printk都不可用。所以自己编写了串口打印函数。
void print_s(char *s){
while(*s!=0){
while(!((*(unsigned char *)0xf0532014) & 32)); //等待串口缓冲区空
*(unsigned char *)0xf0532000 = *s; //发送一个字符
s++;
if(*s == '\n'){
while(!((*(unsigned char *)0xf0532014) & 32)); //等待串口缓冲区空
*(unsigned char *)0xf0532000 = '\r';
}
}
while(!((*(unsigned char *)0xf0532014) & 32));
}
asmlinkage int print_uart(const char *fmt, ...){
va_list args;
int i;
int count;
char printk_buf[1024];
memset(printk_buf, 0, sizeof(printk_buf));<