Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Apr 2019 05:11:22 -0700
From:      Enji Cooper <yaneurabeya@gmail.com>
To:        abhja kaanlani <unidef_rogue@live.com>
Cc:        Alan Somers <asomers@freebsd.org>, "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: (HBI) Implementing SQLite into the FreeBSD kernel
Message-ID:  <4250C851-5CB2-4B0B-8D9B-58414F806D75@gmail.com>
In-Reply-To: <BYAPR02MB5704499A6E998215AB942EFF83390@BYAPR02MB5704.namprd02.prod.outlook.com>
References:  <BYAPR02MB57041D1DC9D5AE7EABDFF53583380@BYAPR02MB5704.namprd02.prod.outlook.com> <CAOtMX2jcySOnNUTtr1D48mYH_kb-aenw8o7%2B2v897otUAr6jgA@mail.gmail.com> <BYAPR02MB5704499A6E998215AB942EFF83390@BYAPR02MB5704.namprd02.prod.outlook.com>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Apr 28, 2019, at 9:20 PM, abhja kaanlani <unidef_rogue@live.com> =
wrote:
>=20
> It can be used for messaging. Let=E2=80=99s 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
>=20
> and sadly I don=E2=80=99t know much of sql. I have a neural database =
in the works but that=E2=80=99s 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
>=20
> It could be used for up, but there=E2=80=99s way too much overhead I =
think, once I sit down with my cigarettes and read the entire kernel on =
my desktop I=E2=80=99ll see if I can add a database like this to some =
drivers or file system code
>=20
>=20
>=20
> struct idb_node0 {=20
> int *id;
> char *idb_node_description;
> struct idb_node0 *id_node0_direction[MACRO_AND_ENUM_GOES_HERE]  // =
additional dimensions if ram calculation allows, I=E2=80=99d suggest =
some kind of matrice
> };
>=20
> struct idb_binary_tree {=20
> int id;
> char *idb_binary_tree_description;
> struct node0 *idb_binary_tree_direction[MACRO_ENUM];
> }
>=20
> Etc sorry I didn=E2=80=99t have time to write the macros and =
enumerations
>=20
> 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
>=20
>=20
> What I=E2=80=99m 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=E2=80=99s =
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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4250C851-5CB2-4B0B-8D9B-58414F806D75>