ladybird/Kernel
Liav A 2c84466ad8 Kernel/Storage: Introduce new boot device addressing modes
Before of this patch, we supported two methods to address a boot device:
1. Specifying root=/dev/hdXY, where X is a-z letter which corresponds to
a boot device, and Y as number from 1 to 16, to indicate the partition
number, which can be omitted to instruct the kernel to use a raw device
rather than a partition on a raw device.
2. Specifying root=PARTUUID: with a GUID string of a GUID partition. In
case of existing storage device with GPT partitions, this is most likely
the safest option to ensure booting from persistent storage.

While option 2 is more advanced and reliable, the first option has 2
caveats:
1. The string prefix "/dev/hd" doesn't mean anything beside a convention
on Linux installations, that was taken into use in Serenity. In Serenity
we don't mount DevTmpFS before we mount the boot device on /, so the
kernel doesn't really access /dev anyway, so this convention is only a
big misleading relic that can easily make the user to assume we access
/dev early on boot.
2. This convention although resemble the simple linux convention, is
quite limited in specifying a correct boot device across hardware setup
changes, so option 2 was recommended to ensure the system is always
bootable.

With these caveats in mind, this commit tries to fix the problem with
adding more addressing options as well as to remove the first option
being mentioned above of addressing.
To sum it up, there are 4 addressing options:
1. Hardware relative address - Each instance of StorageController is
assigned with a index number relative to the type of hardware it handles
which makes it possible to address storage devices with a prefix of the
commandset ("ata" for ATA, "nvme" for NVMe, "ramdisk" for Plain memory),
and then the number for the parent controller relative hardware index,
another number LUN target_id, and a third number for LUN disk_id.
2. LUN address - Similar to the previous option, but instead we rely on
the parent controller absolute index for the first number.
3. Block device major and minor numbers - by specifying the major and
minor numbers, the kernel can simply try to get the corresponding block
device and use it as the boot device.
4. GUID string, in the same fashion like before, so the user use the
"PARTUUID:" string prefix and add the GUID of the GPT partition.

For the new address modes 1 and 2, the user can choose to also specify a
partition out of the selected boot device. To do that, the user needs to
append the semicolon character and then add the string "partX" where X
is to be changed for the partition number. We start counting from 0, and
therefore the first partition number is 0 and not 1 in the kernel boot
argument.
2022-08-30 00:50:15 +01:00
..
API Kernel: Remove big lock from sys$socket 2022-08-23 20:29:50 +02:00
Arch Kernel/aarch64: Implement VERIFY_INTERRUPTS_{ENABLED, DISABLED} 2022-08-26 12:51:57 +02:00
Bus Kernel/USB: Rework UHCI interrupt transfer schedule 2022-08-28 13:40:07 +02:00
Devices Kernel: Simplify the File memory-mapping API 2022-08-24 14:57:51 +02:00
FileSystem Kernel: Simplify the File memory-mapping API 2022-08-24 14:57:51 +02:00
Firmware Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
Graphics Kernel: Simplify the File memory-mapping API 2022-08-24 14:57:51 +02:00
Heap Kernel: Stop taking MM lock while using PD/PT quickmaps 2022-08-22 17:56:03 +02:00
Interrupts Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
Library Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
Locking Kernel: Move Spinlock functions back to arch independent Locking folder 2022-08-26 12:51:57 +02:00
Memory Kernel: Dump OOM debug info after releasing the MM global data lock 2022-08-27 21:54:13 +03:00
Net Kernel: Use Process::credentials() and remove user ID/group ID helpers 2022-08-22 12:46:32 +02:00
Prekernel Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Storage Kernel/Storage: Introduce new boot device addressing modes 2022-08-30 00:50:15 +01:00
Syscalls Kernel: Don't wrap AddressSpace's RegionTree in SpinlockProtected 2022-08-24 14:57:51 +02:00
Tasks Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
Time Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
TTY Kernel: Use Process::credentials() and remove user ID/group ID helpers 2022-08-22 12:46:32 +02:00
AddressSanitizer.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
AddressSanitizer.h Everywhere: Use bgianf@serenityos.org for my copyright attribution 2021-04-22 21:15:54 +02:00
Assertions.h Kernel/aarch64: Implement VERIFY_INTERRUPTS_{ENABLED, DISABLED} 2022-08-26 12:51:57 +02:00
AtomicEdgeAction.h Kernel: Add per platform Processor.h headers 2021-10-14 01:23:08 +01:00
BootInfo.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
CMakeLists.txt Kernel/Storage: Introduce new boot device addressing modes 2022-08-30 00:50:15 +01:00
CMOS.cpp Kernel: Move x86 IO instructions code into the x86 specific folder 2021-10-01 12:27:20 +02:00
CMOS.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
CommandLine.cpp Kernel/Storage: Introduce new boot device addressing modes 2022-08-30 00:50:15 +01:00
CommandLine.h Kernel/Graphics: Simplify the feature level of the Graphics subsystem 2022-05-05 20:55:57 +02:00
Coredump.cpp Kernel: Don't wrap AddressSpace's RegionTree in SpinlockProtected 2022-08-24 14:57:51 +02:00
Coredump.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
Credentials.cpp Kernel: Make VirtualFileSystem functions take credentials as input 2022-08-21 16:02:24 +02:00
Credentials.h Kernel: Make VirtualFileSystem functions take credentials as input 2022-08-21 16:02:24 +02:00
Debug.h.in Kernel/FileSystem: Use a new debug flag for SysFS debug messages 2022-08-08 02:33:25 +00:00
DoubleBuffer.cpp Kernel: Annotate all KBuffer and DoubleBuffer with a custom name 2022-07-12 00:55:31 +01:00
DoubleBuffer.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
embedmap.sh Kernel: Make new kernel build process work on macOS 2021-07-15 11:04:30 +02:00
Forward.h Kernel: Add Credentials to hold a set of user and group IDs 2022-08-20 18:32:50 +02:00
FutexQueue.cpp Kernel: Propagate OOM conditions out of sys$futex 2022-07-21 16:39:22 +02:00
FutexQueue.h AK+Kernel: Add AK::AtomicRefCounted and use everywhere in the kernel 2022-08-20 17:15:52 +02:00
GlobalProcessExposed.cpp Kernel: Wrap process address spaces in SpinlockProtected 2022-08-24 14:57:51 +02:00
init.cpp Kernel: Changed serial debug functions and variables for readability 2022-08-27 19:42:52 +01:00
KBuffer.h Kernel: Annotate all KBuffer and DoubleBuffer with a custom name 2022-07-12 00:55:31 +01:00
KBufferBuilder.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
KBufferBuilder.h Kernel: Expose .length() of KBufferBuilder 2022-05-06 02:12:51 +04:30
KLexicalPath.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
KLexicalPath.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
kprintf.cpp Kernel: Changed serial debug functions and variables for readability 2022-08-27 19:42:52 +01:00
kstdio.h Kernel: Changed serial debug functions and variables for readability 2022-08-27 19:42:52 +01:00
KString.cpp Kernel: Add an error propagating KString::format(..) API :^) 2021-11-30 11:16:35 +01:00
KString.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
KSyms.cpp Kernel: Move Kernel/Arch/x86/SafeMem.h to Kernel/Arch/SafeMem.h 2022-05-03 21:53:36 +02:00
KSyms.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
MiniStdLib.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
mkmap.sh Kernel: Use the toolchain's nm in mkmap.sh 2021-12-30 18:10:51 +01:00
Multiboot.h Kernel: Only use multiboot framebuffer details if present 2022-01-06 22:34:11 +01:00
Panic.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Panic.h Kernel: Implement __panic() for the aarch64 Kernel 2022-05-03 21:53:36 +02:00
PerformanceEventBuffer.cpp Kernel: Don't wrap AddressSpace's RegionTree in SpinlockProtected 2022-08-24 14:57:51 +02:00
PerformanceEventBuffer.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
PerformanceManager.h Everywhere: Use default StringView constructor over nullptr 2022-07-12 23:11:35 +02:00
PhysicalAddress.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Process.cpp Kernel: Wrap process address spaces in SpinlockProtected 2022-08-24 14:57:51 +02:00
Process.h Kernel: Stop verifying interrupts are disabled in Process::for_each 2022-08-27 21:54:13 +03:00
ProcessExposed.cpp Kernel: Update atime/ctime/mtime timestamps atomically 2022-08-22 17:56:03 +02:00
ProcessExposed.h Kernel: Update atime/ctime/mtime timestamps atomically 2022-08-22 17:56:03 +02:00
ProcessGroup.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
ProcessGroup.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
ProcessProcFSTraits.cpp Kernel: Use Process::credentials() and remove user ID/group ID helpers 2022-08-22 12:46:32 +02:00
ProcessSpecificExposed.cpp Kernel: Don't wrap AddressSpace's RegionTree in SpinlockProtected 2022-08-24 14:57:51 +02:00
Random.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
Random.h Kernel: Require lock rank for Spinlock construction 2022-08-19 20:26:47 -07:00
RTC.cpp Everywhere: Fix many spelling errors 2022-01-07 10:56:59 +01:00
RTC.h Kernel: Ensure we read valid values from the RTC CMOS registers 2021-08-04 19:53:04 +02:00
SanCov.cpp Kernel: Add some implied auto qualifiers 2021-12-30 14:32:17 +01:00
Scheduler.cpp Kernel: Reorganize and colorize the scheduler thread list dump 2022-08-26 13:07:07 +02:00
Scheduler.h Kernel: Use InterruptsState in Spinlock code 2022-08-26 12:51:57 +02:00
Sections.h Kernel: Make the page table quickmaps per-CPU 2022-08-22 17:56:03 +02:00
StdLib.cpp Kernel: Move Kernel/Arch/x86/SafeMem.h to Kernel/Arch/SafeMem.h 2022-05-03 21:53:36 +02:00
StdLib.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
Syscall.cpp Kernel: Wrap process address spaces in SpinlockProtected 2022-08-24 14:57:51 +02:00
Thread.cpp Kernel: Remove global MM lock in favor of SpinlockProtected 2022-08-26 01:04:51 +02:00
Thread.h Kernel: Show more (b)locking info when dumping the process list 2022-08-26 13:07:07 +02:00
ThreadBlockers.cpp Kernel: Use InterruptsState in Spinlock code 2022-08-26 12:51:57 +02:00
ThreadTracer.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
ThreadTracer.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
TimerQueue.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
TimerQueue.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
UBSanitizer.cpp Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
UnixTypes.h Kernel: Add support for SA_SIGINFO 2022-03-04 20:07:05 +01:00
UserOrKernelBuffer.cpp Kernel: Replace KResult and KResultOr<T> with Error and ErrorOr<T> 2021-11-08 01:10:53 +01:00
UserOrKernelBuffer.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
VirtualAddress.h Everywhere: Add sv suffix to strings relying on StringView(char const*) 2022-07-12 23:11:35 +02:00
WaitQueue.cpp Kernel: Don't register thread as custom data for WaitQueueBlocker 2021-08-24 01:57:11 +02:00
WaitQueue.h Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
WorkQueue.cpp Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00
WorkQueue.h Kernel: Make self-contained locking smart pointers their own classes 2022-08-20 17:20:43 +02:00