Hi,
Griwes wrote:
Yeah, it was a little chaotic ;D
Consider following file, to be included for every FS-specific (or MBR-specific, doesn't matter) bootsector:
Code:
bits 16
org 0x7c00
%macro begin 0
begin:
jmp 0x0:start
%endmacro
%macro code 0
start:
mov ax, 0
mov ds, ax
mov es, ax
; ...all the bootloader code
%endmacro
%macro fill 0
times 510 - ($-$$) db 0
dw 0xaa55
%endmacro
Then, an example of actual bootsector file would be:
Code:
%include "gandboot.inc"
begin
db "Example Label "
; ...whatever is required to be here
code
fill
I would have to think for a moment about generating those masks, though (like: original data - 0x93, 0x54, 0xff, 0xac; bootloader - 0x00, 0xac, 0xac, 0xef; mask - 0x00, 0xff, 0xff, 0x00 => 0x93, 0xac, 0xac, 0xac; hope you get the idea). The point in it is to ease creating bootsectors for exotic filesystems.
That... really shouldn't be required. The disk-specific code would be all same (one binary to rule 'em all), while the fs-specific code would be all different (so no need for any macros there). Unless I really missed your point again, and you meant something different...
Griwes wrote:
Shikhin wrote:
Griwes wrote:
Finally, other features it would have to have, or could have - more important first:
- memory map sanitization - probably not necessary for UEFI (*probably*), but definitely recommended for ol' BIOS
- VBE mode setting (configurable at install)
- getting IOAPICs and LAPICs in known state (it's not much work, after all; by known state, I mean "disable everything you can")
- if it would already mess with APICs, maybe some basic ACPI parsing (like combining various entries of MADT, creating table that doesn't have variable-length entries, maybe - not much people would use it, but having that data parsed by write-once-use-all-the-time tool wouldn't hurt, especially when there is no SRAT and SLIT - applying SRAT/SLIT to that MADT structure and to memory map) - I mean, one table with variable length entries less to parse = profit!
- (?) AP booting (?)
Fine, but: I would recommend against configuration files. Let the specification define bytes in 2nd stage that are responsible for given settings; that would remove the necessity to implement configuration file parsing in bootloader - at the cost of readability of settings, but creating small driver to change those settings based on some kind of CLI or GUI shouldn't be hard (granted you have driver for storage device). For example, in POSIXish environment, the driver could expose `/dev/bootloader`, allowing read/write access in some human-readable format.
Also, you meant PIC, not PIT, right?
And to get truly clean state, you should also - IMHO - at least mask IOAPICs. Plus, I would drop MP support entirely; ACPI is there for really long time.
Those would be okay - but for things like a module list, you would need a configuration file.
Yes, PIC.
We might look into IOAPIC. As for dropping MP support - I don't believe we should drop support for anything. We should try to support as archaic a system as possible, so that it can fit the demands for everyone (
Want support for a 486? No worries, GANDALF can do that! or
Want support for my latest 512-core machine, with Microsoft's new PUFU firmware? No worries, GANDALF can do that!).
bluemoon wrote:
If stages are broken down nicely, each stage is sufficiently small and don't need the macro to add extra dependency / complexity.
And I expect the amount of common code for each "small stage" is just a few instructions.
Exactly my point (please refer to design explained above).
/me skips replying to the next ~10 posts - those should be well answered by my previous design post.dozniak wrote:
It seems to me that you're designing GRUB here, folks.
No trolling, despite some weaklings attempting to pose it so.
Sorry, it just seems way to obvious to me.
You want to support different boot modes via modules - grub has them, you wan to support different filesystems support through modules and different stages - grub has them, and so on.
I'm afraid that starting from scratch without even having a reference to already made mistakes just asks for making these same mistakes and some more for shure.
I'm afraid we aren't designing GRUB here. Sorry, GNU.
Anyway, we do have some sort of a reference - multiboot. We know it's mistakes, and what it does correctly. We're learning from it, and we think we'll do everything much better.
Primis wrote:
Count me in,
A bootloader shouldn't be larger than the kernel it's loading...
My only request is that we make this BSD-License Compatible.
Code:
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Gandalf Team <
[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE **** YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE **** YOU WANT TO.
Anyone?
Regards,
Shikhin