Aptivi - Manual
ProjectsWebsiteBlog
Nitrocid KS v0.1.2 - Rolling Manual
Nitrocid KS v0.1.2 - Rolling Manual
  • Welcome!
  • Version Release Notes
  • Installation and Maintenance
    • Installing the Kernel
      • Windows
      • macOS
      • Linux
      • Android
    • Upgrading the Kernel
      • Windows
      • macOS
      • Linux
      • Android
    • Dependency Information
  • Fundamentals
    • What is the Kernel?
    • What is Nitrocid KS?
    • Simulated Kernel Features
      • Extra Features
        • More Networking
          • FTP Client
          • SSH Connection
          • SFTP Client
          • RSS Client
          • HTTP Client
          • Mail Client
        • Games and Amusements
          • Hangman
          • BackRace
          • Meteor
          • Pong
          • Russian Roulette
          • ShipDuet
          • Snaker
          • Solver
          • SpeedPress
          • Wordle
        • More Editors
          • JSON Editor
          • SQL Editor
        • Common Programs
          • Archive
          • Caffeine
          • Calendar
          • Calculator
          • Contacts
          • Dictionary
          • Git Shell
          • Notes
          • Stocks
          • Timers
          • To-do List
          • Unit Converter
          • Weather
        • Docking
        • Language Studio
        • Theme Studio
      • Accounts
        • Groups
        • Permissions
      • Editors
        • Text Editor
        • Hex Editor
      • Shells
        • Commands List
        • Addon Commands List
      • Files and Folders
        • Hashing and Encryption
      • The Nitrocid Homepage
      • Networking
      • Localization
      • Screensavers
      • Lockscreen Widgets
      • Audio Cues
  • Advanced and Power Users
    • Building the Kernel
      • Building on Windows
      • Building on macOS
      • Building on Linux
      • Building on Android
    • Kernel Modifications
      • Building your Mod
      • Analyzing your Mod
        • Text - NKS0001
        • ConsoleBase - NKS0002
        • ConsoleBase - NKS0003
        • ConsoleBase - NKS0004
        • ConsoleBase - NKS0005
        • ConsoleBase - NKS0006
        • ConsoleBase - NKS0007
        • ConsoleBase - NKS0008
        • ConsoleBase - NKS0009
        • Files - NKS0010
        • Files - NKS0011
        • Files - NKS0012
        • Files - NKS0013
        • Files - NKS0014
        • Files - NKS0015
        • Files - NKS0016
        • Files - NKS0017
        • Files - NKS0018
        • Files - NKS0019
        • Files - NKS0020
        • Files - NKS0021
        • Files - NKS0022
        • Files - NKS0023
        • Kernel - NKS0024
        • Kernel - NKS0025
        • Kernel - NKS0026
        • Kernel - NKS0027
        • Kernel - NKS0031
        • Kernel - NKS0032
        • Kernel - NKS0033
        • Kernel - NKS0037
        • Kernel - NKS0038
        • Kernel - NKS0039
        • Kernel - NKS0040
        • Kernel - NKS0041
        • Kernel - NKS0042
        • Kernel - NKS0043
        • Kernel - NKS0052
        • Kernel - NKS0053
        • Languages - NKS0044
        • Languages - NKS0045
        • Languages - NKS0046
        • Network - NKS0051
        • Text - NKS0047
        • Text - NKS0048
        • Text - NKS0049
        • Text - NKS0050
        • Text - NKS0054
        • Text - NKS0055
      • Managing your Mod
        • Inter-Mod Communication
        • Inter-Addon Communication
    • Diagnostics
      • Debugging
        • Local Debugging
        • Remote Debugging
      • Testing
      • Other Diagnostics
    • Bootloader
      • Boot Choices
      • Kernel Environments
      • Custom Boot Styles
    • Inner Workings
      • Kernel Settings
        • Mechanics of Settings App
        • Settings Format
        • Custom Settings
      • Shell Structure
        • Help System
        • Command Parsing
        • Command Information
        • Command Switches
        • Shell History
        • Shell Scripting
        • Shell Presets
        • Extra Shell Features
      • Multilingual Kernel
        • Locale Tools
        • Custom Languages
      • Inner Essentials
        • Kernel Drivers
          • Console Drivers
          • Debug Logger Drivers
          • Encoding Drivers
          • Encryption Drivers
          • Filesystem Drivers
          • Hardware Prober Drivers
          • Input Drivers
          • Network Drivers
          • RNG Drivers
          • Regular Expression Drivers
          • Sorting Drivers
        • Kernel Placeholders
        • The Permissions
        • The Users
        • Kernel Threads
        • Kernel Arguments
        • Kernel Journaling
        • Remote Procedure
        • Nitrocid Filesystem
        • Screensaver Internals
        • Splash Internals
        • Kernel Platform
        • Theme Internals
        • Color Internals
        • Privacy Consents
        • System Notifications
        • MAL and MOTD
        • Progress Handlers
        • Assembly Signing
        • Assembly Reflection
        • Random Number Generation
        • Network Tools
        • Date and Time
        • Mod Manual Pages
      • Miscellaneous APIs
  • Project Dependencies
  • Report an issue
  • Source code
  • API Reference
Powered by GitBook
On this page
  • Implementing your style
  • Key handling
  • Bootloader state
Edit on GitHub
  1. Advanced and Power Users
  2. Bootloader

Custom Boot Styles

Make your own custom boot style!

When Nitrocid reads the configuration file, the bootloader parses the boot style name and attempts to load that style. Your mods can load custom boot styles by consulting functions in the BootStyleManager class that allows you to add your own custom boot style to the bootloader.

Implementing your style

To implement your custom boot style, these steps must be followed:

  1. Assuming that you have your mod's source code, create a class and name it after your boot style that you want.

  2. Write next to the class file : BaseBootStyle, IBootStyle and import the required namespace by using Nitrocid.Kernel.Starting.Bootloader.Style;.

  3. Override the necessary methods using the override keyword for each one as appropriate.

    • public override Dictionary<ConsoleKeyInfo, Action<BootAppInfo>> CustomKeys { get; }

    • public override string Render()

    • public override string RenderHighlight(int chosenBootEntry)

    • public override string RenderModalDialog(string content)

    • public override string RenderBootingMessage(string chosenBootName)

  4. Now, implement everything as you wish. Once you're done, add necessary functions in the mod initialization phase to add your own custom boot style.

  5. Click on the Build menu and select Build Solution.

  6. Repeat the steps to install your mod as highlighted in .

Key handling

Your custom boot style can make use of the custom key bindings to do custom actions. They can be defined by overriding the CustomKeys dictionary with a new dictionary containing the console key and the action with the boot app info passed to it as an argument, like below:

public override Dictionary<ConsoleKeyInfo, Action<BootAppInfo>> CustomKeys { get; } = new()
{
    { new ConsoleKeyInfo(...), (bai) => ... }
}

If any key other than the UP ARROW, DOWN ARROW, and ENTER, the key handler attempts to parse the key according to the custom key list defined by your boot style. If the key pressed is the same as one of the defined keys, the handler executes the action with the chosen boot application, whose type is BootAppInfo, as the argument passed to it.

Bootloader state

You can also access the bootloader state by referencing the BootloaderState class. This class provides you with the following options:

  • WaitingForBootKey

  • WaitingForFirstBootKey

This can be used for your custom boot styles to change their behavior, depending on the state.

this page