(HBI) Implementing SQLite into the FreeBSD kernel

abhja kaanlani unidef_rogue at live.com
Mon Apr 29 04:21:01 UTC 2019


It can be used for messaging. Let’s say, for any reason, a userland command needs to access the sound hardware, there can be a string sql value (or just a string, kind of like sysctl) attached to a driver, and it can contain metadata for automation or parsing, maybe even a callback system

and sadly I don’t know much of sql. I have a neural database in the works but that’s moving to c++, but a simple binary tree with a couple of character arrays and an id along with search functions (Libc can handle this fine) can simulate a small database without consuming too much memory once written to disk

It could be used for up, but there’s way too much overhead I think, once I sit down with my cigarettes and read the entire kernel on my desktop I’ll see if I can add a database like this to some drivers or file system code



struct idb_node0 { 
int *id;
char *idb_node_description;
struct idb_node0 *id_node0_direction[MACRO_AND_ENUM_GOES_HERE]  // additional dimensions if ram calculation allows, I’d suggest some kind of matrice
};

struct idb_binary_tree { 
int id;
char *idb_binary_tree_description;
struct node0 *idb_binary_tree_direction[MACRO_ENUM];
}

Etc sorry I didn’t have time to write the macros and enumerations

Macros and enumerations are used to keep how many items in an array, what dimension should the array have if ram permissible, and keep track of nodes and indices


What I’m getting at is a hardcoded database has its benefits!

Sent from my iPhone

> On Apr 28, 2019, at 10:03 AM, Alan Somers <asomers at freebsd.org> wrote:
> 
>> On Sun, Apr 28, 2019 at 10:57 AM abhja kaanlani <unidef_rogue at live.com> wrote:
>> 
>> HBI stands for half baked idea
>> 
>> I don’t know much about the FreeBSD kernel, but we can add sql metadata to certain code for self contained documentation
>> 
>> What does everyone think?
>> 
>> Sent from my iPhone
> 
> Are you actually trying to use SQLite to implement an in-kernel
> database, or are you trying to automatically generate API
> documentation using SQLite?  Those are two very different things.  If
> the latter, I suggest you try Doxygen instead.  There are already
> portions of the kernel that use Doxygen's comment format.
> -Alan


More information about the freebsd-hackers mailing list