Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database without operating system required for embedded system

Is there any database which does not require operating system to perform operations? If yes, please provide the details like size or links with details.

Programming language is C.

Required for embedded system programming.

like image 383
user1042813 Avatar asked Jul 12 '12 13:07

user1042813


People also ask

Do embedded systems require an operating system?

Akin to a desktop PC that requires an OS like Windows, Linux, or Mac OS to run basic apps, embedded systems also need an operating system to facilitate and expedite their functionality.

What database is used in embedded systems?

solidDB. solid DB is a hybrid on-disk/in-memory, relational database and is often used as an embedded system database in telecommunications equipment, network software, and similar systems.

Which operating system is used in embedded system?

Linux and Android are two powerful operating systems used in most of the embedded systems today.

Is SQL used in embedded systems?

Embedded SQL applications connect to databases and execute embedded SQL statements. The embedded SQL statements are contained in a package that must be bound to the target database server. You can develop embedded SQL applications for the Db2® database in the following host programming languages: C, C++, and COBOL.


1 Answers

Well, it depends on how you define 'operating system'.

  • If you define it as something with a GUI that runs on x86 hardware; sure; most databases will run just fine on other systems.
  • If you define it as something that implements the POSIX spec or otherwise allows threads or processes to run and provides a measure of security, well, you'll loose a few that require multithreaded operation but you'll still be fine; there are lots of options.
  • If you define it as something that doesn't have any file operations at all, and doesn't implement much of the C standard library, you're pretty much out of luck.

Your ARM-based device almost certainly has a C standard library that ships with the toolchain. Newlib is a popular choice for deeply embedded systems; it's included by default in, for example, the free CodeSourcery and YARTGO toolchains. However, you need to implement some syscalls before that will work. Can you do, say, printf() and have text appear on a console? How about malloc()? If those and other functions don't work, I'd suggest that you implement them. The basic syscalls that Newlib expects are:

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);

Most of these can be stubs, but you need, for example, _write() for printf() (and other writing operations), _read() for reading operations, and _sbrk() for malloc and other memory management functions. See, for example, http://wiki.osdev.org/Porting_Newlib for a minimal implementation. Your definitions of these functions will determine how the database works; if _write() sends a character to the UART then your database won't be very useful.

With the standard library working, sqlite and other databases should work. They'll do things like this in shell.c from the sqlite amalgamation:

#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>

You need some implementation of those. This does not require an operating system. With a C library, it will work, but without one, you're on your own.

like image 111
Kevin Vermeer Avatar answered Oct 13 '22 01:10

Kevin Vermeer