(HBI) Implementing SQLite into the FreeBSD kernel

Enji Cooper yaneurabeya at gmail.com
Mon Apr 29 12:11:26 UTC 2019


> On Apr 28, 2019, at 9:20 PM, abhja kaanlani <unidef_rogue at live.com> wrote:
> 
> 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!

Hi Abhja,

SQLite in the kernel seems a wrong option for dealing with key-value stores.

Are you aware of libnv in FreeBSD (and its kernel analog)? It’s a key-value store library/infrastructure, available for kernel use.

FreeBSD also has access to radix tries too, if the structure matters.

Hope this helps,
-Enji


More information about the freebsd-hackers mailing list