Skip to content

USB boot - #191

Open
y4my4my4m wants to merge 9 commits into
masterfrom
usb-boot
Open

USB boot#191
y4my4my4m wants to merge 9 commits into
masterfrom
usb-boot

Conversation

@y4my4my4m

@y4my4my4m y4my4my4m commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Makes a bootable image (need to raw copy to usb stick). Only tested in QEMU.

This is built from usb-dev-y4m

This commit introduces a comprehensive USB stack, including support for USB mass storage devices and Human Interface Devices (HID) such as keyboards and mice. Key changes include:

- New files for USB core functionality, xHCI host controller, and device enumeration.
- Implementation of bulk-only transport for mass storage devices.
- Integration of HID protocols for keyboard and mouse input.
- Updates to existing block device handling to accommodate USB devices.

This enhancement significantly expands the system's capabilities for handling USB peripherals.
This update modifies the USB stack to replace the function pointer auto_cb with an integer auto_kind for handling HID report callbacks. Changes include:

- Updated endpoint descriptor structure to use auto_kind for specifying report handler types (USB_AUTO_NONE, USB_AUTO_KBD, USB_AUTO_MOUSE).
- Adjusted relevant functions to accommodate this change, enhancing clarity and maintainability of the code.

This refactor streamlines the dispatching of report handlers in the USB HID implementation.
This update modifies the CUsbEP class to store a pointer to CXhciRing instead of embedding it directly. This change addresses limitations in the ZealC JIT class parser regarding nested class structures. Additionally, new initialization functions for endpoint rings have been introduced, ensuring proper memory allocation and initialization on first use. The code has been updated accordingly to reflect these changes, enhancing the overall structure and maintainability of the USB endpoint handling.
This update modifies the USB device structure and related functions to replace the eps array with ep_list for managing USB endpoints. Changes include updating references in the parsing, attachment, and configuration functions to ensure consistency and improve code clarity. This refactor enhances maintainability and aligns with recent structural changes in the USB stack.
This commit enhances the USB stack by integrating USB boot functionality and mass storage support. Key changes include:

- Inclusion of USB boot initialization and fallback mechanisms.
- Implementation of USB mass storage device handling with SCSI commands.
- Updates to the block device management to accommodate USB drives.
- Refactoring of existing USB endpoint management to improve clarity and maintainability.

These enhancements significantly expand the system's capabilities for handling USB peripherals and booting from USB media.
…e functions

This commit introduces runtime-dispatched functions for raw block read and write operations, allowing compatibility with both USB-capable and pre-USB bootstrap kernels. Key changes include:

- Added `DiskPartRawWrite` and `BootMHDRawRead` functions to facilitate whole-device operations.
- Updated existing code to utilize these new functions for improved maintainability and clarity.
- Enhanced USB and boot loader integration by ensuring proper handling of raw block operations.

These modifications streamline the block device management process and improve the overall robustness of the system.
This commit updates the raw block read and write functions across multiple components to utilize a unified runtime dispatch mechanism. Key changes include:

- Replaced direct function pointer retrieval with a more flexible approach using `CHash` to accommodate both public kernel functions and JIT-local functions.
- Enhanced compatibility with USB-capable and pre-USB bootstrap kernels by ensuring proper resolution of function addresses at runtime.

These modifications improve the maintainability and robustness of block device operations in the system.
This commit introduces a new markdown file, `usb-boot-guide.md`, providing detailed instructions for creating a bootable USB disk using QEMU. Key steps include:

- Creating a disk image and partitioning it.
- Formatting the partition with FAT32.
- Using QEMU to boot from the USB image.
- Copying necessary files and configuring the boot process.

This guide enhances user accessibility for booting from USB media and complements recent USB support enhancements in the system.
@y4my4my4m

Copy link
Copy Markdown
Collaborator Author

#192

This PR is largely superior in it's implementation and fixing xHCI initialization. But I figured I'd keep it available in case this was more inlined with the charter or somehow needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant