egranata / puppy

The Puppy Operating System
Apache License 2.0
21 stars 3 forks source link

Versioning strategy #99

Open egranata opened 5 years ago

egranata commented 5 years ago

So far, I have had a rather cavalier attitude to adding, removing and generally changing the interface of files and system calls

This issue tracks devising a scheme by which to expose to userspace information about which "version" of the kernel-to-userland interface is running

This would require freezing one version of that interface, and somehow marking it such that userspace can query for either it collectively or individual bits and pieces thereof as needed.

egranata commented 5 years ago

I made a fair bit of progress on this.

The core of the strategy is based upon the notion of "features" - the kernel exports a list of features it has (so, basically, anything that changes the interface to userland past bf349deeeb0bf992dbd25491a8f8cef57811a65a). Userland can query for features it wants via a system call and ask "do you have all of these?" - yes or no comes back from the kernel.

Each OS build also has a signature, which is the pair of (branch, hash) that it was built from. This is unique and identifying (modulo local changes). The short hash (treated as a hex number) become the OS "version". This is not unique nor identifying, but it is a convenient shorthand for the signature. The version value is not even monotonic, which discourages the antipattern of if (version >= VER0) { and should encourage the pattern of checking for features instead.