Aptivi - Deprecated Manuals
ProjectsWebsiteBlog
Nitrocid KS v0.1.0 Beta 2 - Manual
Nitrocid KS v0.1.0 Beta 2 - Manual
  • 👋Welcome!
  • Versions and Compatibility
    • 🔱Supported Versions
    • 🕘EOL Versions
    • 🗞️Version Release Notes
      • ✨v0.0.1.x series
      • 🌈v0.0.2.x series
      • 👥v0.0.3.x series
      • 🛠️v0.0.4.x series
      • 🕔v0.0.5.x series
        • ⌚v0.0.5.0 Beta Versions
      • 📕v0.0.6.x series
        • 📄v0.0.6.0 Beta Versions
      • 🔌v0.0.7.x series
        • ⚡v0.0.7.0 Beta Versions
      • 🌌v0.0.8.x series
      • 💌v0.0.9.x series
      • 📜v0.0.10.x series
      • ✏️v0.0.11.x series
      • ⚙️v0.0.12.x series
      • 🌐v0.0.13.x series
      • 🏃♀ v0.0.14.x series
      • ⏳v0.0.15.x series
      • ⭐v0.0.16.x series
      • 🌃v0.0.17.x series
      • 🥁v0.0.18.x series
      • 🔧v0.0.19.x series
      • 🍀v0.0.20.x series
      • 🧰v0.0.21.x series
      • 📱v0.0.22.x series
      • 🖥️v0.0.23.x series
      • 👾v0.0.24.x series
      • 🔮v0.1.x.x series
        • ⚠️Known issues for 0.1.0 Beta
    • 👍Compatibility Notes for KS API Revisions
      • 🔼Upgrading from API v1.0
      • 🔼Upgrading from API v1.1
      • 🔼Upgrading from API v1.2
      • 🔼Upgrading from API v1.3
      • 🔼Upgrading from API v2.0
      • 🔼Upgrading from API v2.1
      • 🔼Upgrading to API v3.0
  • Installation and Maintenance
    • 📀Installing the Kernel
      • 💻Windows
      • 🐧Linux
      • 📱Android
    • ⏫Upgrading the Kernel
      • 💻Windows
      • 🐧Linux
      • 📱Android
  • Fundamentals
    • 🌽What is the Kernel?
    • 👾What is Nitrocid KS?
    • 🌟Simulated Kernel Features
      • 👤Accounts
        • 🔓Permissions
      • 🐚Shells
      • 🌍Networking
        • 🗃️FTP Client
        • 🔒SFTP Client
        • 📰RSS Client
        • 🌐HTTP Client
        • 📧Mail Client
      • ✏️Editors
        • 📝Text Editor
        • 🖊️JSON Editor
        • 💾Hex Editor
      • 🇺🇸 Languages
      • 🌌Screensavers
      • 🎮Games and Amusements
        • 🔤Hangman
        • ☄️Meteor
        • 🐍Snaker
        • 🔢Solver
        • ⌨️SpeedPress
        • 🔠Wordle
      • 🗓️Calendar
      • ⏰Stopwatch and Timer
      • ⚖️Calculator and Converter
  • Advanced and Power Users
    • ⚒️Building the Kernel
      • 🪟Building on Windows
      • 🐧Building on Linux
    • 🧰Kernel Modifications
      • 🔧Kernel Modification Management
      • 🏗️Build your...
        • 🧪Your Mod
        • 🌌Your Screensaver
        • 🪄Your Splash
    • 🦠Diagnostics
      • 🔬Debugging
        • 🧬Local Debugging
        • 🛰️Remote Debugging
      • 🧪Testing
      • 💉Other Diagnostics
    • ⚒️Inner Workings
      • 🔧Kernel Settings
        • ⛏️Mechanics of Settings App
        • 🔩Settings Format
      • 🐚Shell Structure
        • ❔Help System
        • 🗜️Command Parsing
        • 📜Shell Scripting
      • 🪧Kernel Placeholders
      • 🔐The Permissions
      • 📞Kernel Threads
      • 🔌Kernel Drivers
      • ⚙️Multilingual Kernel Flow
      • 🌐Custom Languages
      • 📽️Presentation System
      • 🎛️Kernel Arguments
      • 📡Remote Procedure
    • 💿GRILO Bootloader and KS
  • 🧱Project Dependencies
  • Report an issue
  • Source code
  • API Reference
Powered by GitBook
On this page
Edit on GitHub
  1. Advanced and Power Users
  2. Inner Workings

Kernel Drivers

How the kernel drivers work and their role in the kernel

The kernel drivers allows your kernel to provide interfaces for different purposes, from console to filesystem. This is to present the kernel your implementation of different driver types. It's not a device driver, though!

The kernel drivers can be called using either the properties that point to the current driver of each driver type or the DriverHandler.GetDriver<TResult>() function found under the KS.Drivers namespace. These two will return an appropriate driver interface that actually allows you to call their functions that each driver of the same type implements. The types of kernel drivers are listed below:

Driver
Interface
Base
Description

Random

IRandomDriver

BaseRandomDriver

Random number generator drivers

Console

IConsoleDriver

BaseConsoleDriver

Console drivers

Network

INetworkDriver

BaseNetworkDriver

Network drivers

Filesystem

IFilesystemDriver

BaseFilesystemDriver

Filesystem drivers

Encryption

IEncryptionDriver

BaseEncryptionDriver

Encryption drivers

Regexp

IRegexpDriver

BaseRegexpDriver

Regular expression drivers

Each driver contains its own interface containing its own method definitions and their signatures. These interfaces are the ones that you must implement with your mod. The most basic interface for the kernel drivers is IDriver found in the same namespace, which is implemented by the driver-specific interfaces.

The final driver class implementation must implement both the base driver-specific base class and its interface, such as:

internal class Terminal : BaseConsoleDriver, IConsoleDriver

If you have a kernel driver that you wish to register, you'll have to register the kernel driver, passing it the IDriver interface for your driver and the appropriate type. You can use the DriverHandler.RegisterDriver() function to perform this operation, but you should set the current driver to your driver for the target wrappers, like the methods found in the KS.Files namespace that call the current filesystem driver, using the SetDriver<T>() function.

Be sure to unregister your driver with the UnregisterDriver() function, or your driver will not get updated in the list of kernel drivers!

Last updated 1 year ago

⚒️
🔌