use*_*813 6 c database embedded operating-system system
是否有任何数据库不需要操作系统来执行操作?如果是,请提供详细信息或详细信息链接.
编程语言是C.
嵌入式系统编程需要.
好吧,这取决于您如何定义“操作系统”。
您的基于 ARM 的设备几乎肯定具有随工具链一起提供的 C 标准库。 Newlib是深度嵌入式系统的流行选择;例如,它默认包含在免费的 CodeSourcery 和 YARTGO 工具链中。但是,您需要先实现一些系统调用,然后才能起作用。你可以说,printf()让文本出现在控制台上吗?怎么样malloc()?如果这些和其他功能不起作用,我建议您实现它们。Newlib 期望的基本系统调用是:
int _system (const char *);
int _rename (const char *, const char *);
int _isatty (int);
clock_t _times (struct tms *);
int _gettimeofday (struct timeval *, struct timezone *);
void _raise (void);
int _unlink (void);
int _link (void);
int _stat (const char *, struct stat *);
int _fstat (int, struct stat *);
caddr_t _sbrk (int);
int _getpid (int);
int _kill (int, int);
void _exit (int);
int _close (int);
int _open (const char *, int, ...);
int _write (int, char *, int);
int _lseek (int, int, int);
int _read (int, char *, int);
Run Code Online (Sandbox Code Playgroud)
其中大部分可以是存根,但您需要,例如,_write()用于 printf()(和其他写入操作)、_read()读取操作以及_sbrk()malloc 和其他内存管理功能。例如,请参阅http://wiki.osdev.org/Porting_Newlib以获得最小实现。您对这些函数的定义将决定数据库的工作方式;如果 _write() 向 UART 发送一个字符,那么您的数据库将不会很有用。
随着标准库的工作,sqlite和其他数据库应该可以工作。他们会在来自 sqlite 合并的 shell.c 中做这样的事情:
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "sqlite3.h"
#include <ctype.h>
#include <stdarg.h>
#include <signal.h>
#include <pwd.h>
#include <unistd.h>
#include <sys/types.h>
Run Code Online (Sandbox Code Playgroud)
你需要一些实现。这不需要操作系统。使用 C 库,它可以工作,但没有 C 库,您就只能靠自己了。