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

📄 lib.c

📁 open source bios with linux platform, very good and can be reused.
💻 C
字号:
/* lib.c * tag: simple function library * * Copyright (C) 2003 Stefan Reinauer * * See the file "COPYING" for further information about * the copyright and warranty status of this work. */#include "openbios/config.h"#include "asm/types.h"#include <stdarg.h>#include "libc/stdlib.h"#include "libc/vsprintf.h"#include "openbios/kernel.h"/* Format a string and print it on the screen, just like the libc * function printf.  */int printk( const char *fmt, ... ){	char *p, buf[512];	/* XXX: no buffer overflow protection... */	va_list args;	int i;	va_start(args, fmt);	i=vsprintf(buf,fmt,args);	va_end(args);	for( p=buf; *p; p++ )		putchar(*p);	return i;}void *malloc(int size){    extern struct mem cmem;    return mem_alloc(&cmem, size, 4);}void free(void *ptr){	/* Nothing yet */}

⌨️ 快捷键说明

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