Overview

FreeWorld OS follows consistent naming conventions for files, functions, classes, variables, and system components to ensure code clarity and maintainability.

Executable Files

Pattern Example Description
lowercase.exe freeload.exe All lowercase, descriptive name
lowercase.exe fwoskrnl.exe Abbreviation + descriptive (fw = FreeWorld)
lowercase.exe smss.exe Acronym (Session Manager Subsystem)
lowercase.exe csrss.exe Acronym (Client Server Runtime Subsystem)

Dynamic Link Libraries

Pattern Example Description
lowercase.dll hal.dll All lowercase, acronym or abbreviation

C/C++ Functions

Pattern Example Description
component_action bcd_load Component prefix + underscore + action
component_action hal_init Component prefix + underscore + action
component_get_item bcd_get_default_entry Component + get + item name

C/C++ Types

Pattern Example Description
component_name_t bcd_header_t Component prefix + underscore + name + _t suffix
component_name_t hal_info_t Component prefix + underscore + name + _t suffix
component_name_t kernel_info_t Component prefix + underscore + name + _t suffix

JavaScript/Node.js Classes

Pattern Example Description
PascalCase Window Pascal case for class names
PascalCase WindowManager Pascal case, descriptive compound names
PascalCase FreeWorldAPI Pascal case, system prefix

JavaScript/Node.js Methods

Pattern Example Description
camelCase createWindow Camel case for method names
camelCase getSystemInfo Verb + noun in camel case

Window Handles (HWND)

Window handles follow the format:

FW_HWND_<random_id>

Where:

  • FW = FreeWorld prefix
  • HWND = Window Handle identifier
  • <random_id> = Random alphanumeric string

Example: FW_HWND_a3k9j2x1m

Constants

Language Pattern Example
C/C++ UPPER_SNAKE_CASE MAX_INPUT, COLOR_BLUE
JavaScript UPPER_SNAKE_CASE KERNEL_MAGIC (if used)

File Paths

  • Boot Components: boot/COMPONENT/
  • Kernel: kernel/
  • HAL: hal/
  • Services: services/SERVICE/
  • System (Node.js): system/

Magic Numbers

Component Magic Number Format
BCD "FWBCD\0\0\0" 8-byte string
Kernel 0x46524545574F524C 64-bit integer ("FREEWORL")
Boot Sector 0xAA55 16-bit integer (bytes 510-511)