Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#5163 closed enhancement (fixed)

[PATCH] speed-up boot

Reported by: Grey Owned by: stippi
Priority: normal Milestone: R1
Component: System/Boot Loader Version: R1/Development
Keywords: boot Cc: fredrik.holmqvist@…
Blocked By: Blocking: #5341
Has a Patch: no Platform: All

Description

Attached patch for speed-up Haiku boot on 0.75 sec. Main idea: don't wait to give the user the opportunity to press a key for boot menu (current - "space" key) or debug output (current - ECS key), instead to use keyboard state flags - CapsLock and Scroll Lock.
At boot time (after BIOS flushed leds on keyboard) press CapsLock for boot menu or Scroll Lock for debug output.
GRUB and other first level loaders can reset keyboard led state, but not BIOS keyboard flags, so we can use this keys too.

Attachments (4)

boot_keys.patch (1.6 KB ) - added by Grey 10 years ago.
boot_keys2.patch (4.2 KB ) - added by Grey 10 years ago.
modifiers_check.patch (1.7 KB ) - added by tqh 10 years ago.
Here is the patch I use. (Not sure if it's up to style, just an example).
boot_keys3.patch (4.3 KB ) - added by Grey 10 years ago.

Download all attachments as: .zip

Change History (26)

by Grey, 10 years ago

Attachment: boot_keys.patch added

comment:1 by axeld, 10 years ago

While the wait time is indeed way too long for my taste, I don't really like this solution either (the current keys just are a lot more natural and intuitive).

Can't we compromise on half the wait time for now?

in reply to:  1 ; comment:2 by bonefish, 10 years ago

Replying to axeld:

While the wait time is indeed way too long for my taste, I don't really like this solution either (the current keys just are a lot more natural and intuitive).

Can't we compromise on half the wait time for now?

+1 for shortening the wait time. I'd find it nice, if we'd also support holding Shift to enter the boot menu, though (like BeOS' boot loader), since that usually doesn't have side effects when done earlier (e.g. during the BIOS initialization or in the boot menu).

in reply to:  2 comment:3 by Grey, 10 years ago

Replying to axeld:

While the wait time is indeed way too long for my taste, I don't really like this solution either (the current keys just are a lot more natural and intuitive).

Can't we compromise on half the wait time for now?

Let's temporary forget about wait time... I like the current keys too, but I am programmer too. Let us think about end-users. Windows - 93% of market, Mac OS - 5%, *nix and *BSD < 1% Windows, Mac OS and *BSD use F8 for boot menu. So we have also support F8.

Replying to bonefish:

+1 for shortening the wait time. I'd find it nice, if we'd also support holding Shift to enter the boot menu, though (like BeOS' boot loader), since that usually doesn't have side effects when done earlier (e.g. during the BIOS initialization or in the boot menu).

Yes, one more reason for support holding Shift - Mac OS X use it for "Safe Boot".

In all: Space, F8 and holding Shift for "Boot Menu" and ESC for "Debug Output". Is it all, or same additional hot keys?

Replying to axeld:

Can't we compromise on half the wait time for now?

Wait a bit. I have idea how to support all this keys without waiting time. One day required for debuging and testing.

comment:4 by Grey, 10 years ago

How about "Windows key" and "Menu key"?

BTW, look http://www.perlmonks.org/index.pl/jacques?node_id=509130

comment:5 by Grey, 10 years ago

New solution in attached patch. Wait time=0
Use Space, F8, F12, holding RShift or holding LShift for boot menu.
ESC for debug output.
Main idea - search hot keys codes in BIOS keyboard buffer.

P.S. Holding Shift have side effect with GRUB. Do not hold Shift before GRUB menu. Start holding Shift only after GRUB menu will be on screen!

by Grey, 10 years ago

Attachment: boot_keys2.patch added

comment:6 by tqh, 10 years ago

On my systems I've removed the wait-time and use CTRL and ALT modifiers. (It worked on BeOS as well). SHIFT seems to be used earlier in the bootloader though.

by tqh, 10 years ago

Attachment: modifiers_check.patch added

Here is the patch I use. (Not sure if it's up to style, just an example).

comment:7 by tqh, 10 years ago

Cc: fredrik.holmqvist@… added

comment:8 by axeld, 10 years ago

Apart from a few coding style issues (kbd -> keyboard, cikl12 -> ?, space after comma), why are you scanning the buffer twice, and don't check for all the values in one go? Why should the menu have precedence over the debug output? (if that is the intention)

Maybe the function should return a flags field instead that indicates if debug output or the menu have been requested (or both)?

Also, I'm not sure if removing the wait time completely is such a good idea, but I guess we'll see once we play around with it a bit.

in reply to:  8 comment:9 by Grey, 10 years ago

Replying to axeld:

... why are you scanning the buffer twice, and don't check for all the values in one go? Why should the menu have precedence over the debug output? (if that is the intention)

That is correct intention. Because ESC used in GRUB menu for navigation, and we can find it in keyboard buffer. In any case it will be possible to start debug output from boot_loader menu.

May be the function should return a flags field instead that indicates if debug output or the menu have been requested (or both)?

IMHO, no sense to do it.

Also, I'm not sure if removing the wait time completely is such a good idea, but I guess we'll see once we play around with it a bit.

Why? Good OS have to be load fast!

Apart from a few coding style issues (kbd -> keyboard, cikl12 -> ?, space after comma),

Style corrected patch will be ready soon...

by Grey, 10 years ago

Attachment: boot_keys3.patch added

in reply to:  8 comment:10 by Grey, 10 years ago

Replying to axeld:

8 days ago attachment boot_keys3.patch added. Is it ok for trunk?

comment:11 by stippi, 10 years ago

Owner: changed from axeld to stippi
Status: newin-progress

In my opinion, yes. It's now much easier to reach the boot menu. Just press Shift before Haiku even starts to boot. But the documentation will need to be updated as well.

comment:12 by stippi, 10 years ago

Resolution: fixed
Status: in-progressclosed

Applied in hrev35050 and also updated the boot loader documentation. Hope this was the only place.

comment:13 by andreasf, 10 years ago

Blocking: 5341 added

(In #5341) Bisection shows hrev35050 as first bad commit. Any ideas?

comment:14 by fano, 10 years ago

In my case I've side effects.

I'm using a USB Key as boot disk, so I must press F8 during BIOS start to show boot menu and select the USB key, instead of Haiku starting I've the Boot Menu and I must choose "continue booting".

It seems to me that F8 remains in buffers and so "Boot Menu" is triggered...

It's pretty annoying!

comment:15 by stippi, 10 years ago

Sounds to me like it would be a solution not to use as many keys as we can think of. The shift and space key alone to enter the boot menu should be enough. I don't think this can conflict with anything else.

in reply to:  15 comment:16 by jackburton, 10 years ago

Replying to stippi:

Sounds to me like it would be a solution not to use as many keys as we can think of. The shift and space key alone to enter the boot menu should be enough. I don't think this can conflict with anything else.

Agreed.

comment:17 by fano, 10 years ago

Yes if is impossible to clear the buffer from BIOS (I have pressed F8 to have the BIOS boot menu, not Haiku one), it is more secure to use unused keys SHIFT and SPACE are right, as they're unused, by any BIOS I think.

in reply to:  14 comment:18 by Grey, 10 years ago

Replying to fano:

In my case I've side effects.

I'm using a USB Key as boot disk, so I must press F8 during BIOS start to show boot menu and select the USB key, instead of Haiku starting I've the Boot Menu and I must choose "continue booting".

Quote from Grey:

Let's temporary forget about wait time... I like the current keys too, but I am programmer too. Let us think about end-users. Windows - 93% of market, Mac OS - 5%, *nix and *BSD < 1% Windows, Mac OS and *BSD use F8 for boot menu. So we have also support F8.

F8 - de facto standart for boot menu.

Replying to stippi:

Sounds to me like it would be a solution not to use as many keys as we can think of. The shift and space key alone to enter the boot menu should be enough. I don't think this can conflict with anything else.

Holding Shift have side effect with GRUB. Do not hold Shift before GRUB menu. Start holding Shift only after GRUB menu will be on screen!

comment:19 by fano, 10 years ago

The scope of this was to speed up the (already fast!) boot process avoiding the way to user pressing "space bar"... well in my case the affect obtained is the contrary!

I have to press F8 to choose the USB Key to boot Haiku never start automatically anymore! It stucks in the boot menu waiting for the slowest thing in the Earth (ME) to press "Continue booting"...

Sincerely I prefer that it waited 0.75 seconds and not have to press "Continue booting".

in reply to:  19 ; comment:20 by Grey, 10 years ago

Replying to fano:

The scope of this was to speed up the (already fast!) boot process avoiding the way to user pressing "space bar"... well in my case the affect obtained is the contrary!

I have to press F8 to choose the USB Key to boot Haiku never start automatically anymore! It stucks in the boot menu waiting for the slowest thing in the Earth (ME) to press "Continue booting"...

Sincerely I prefer that it waited 0.75 seconds and not have to press "Continue booting".

How about the idea: Bootloader will check type of boot disk, and if it's USB - ignore F8 keykode in keyboard buffer?

in reply to:  20 comment:21 by axeld, 10 years ago

Version: R1/alpha1R1/Development

Replying to Grey:

How about the idea: Bootloader will check type of boot disk, and if it's USB - ignore F8 keykode in keyboard buffer?

I think that's pretty much overkill. Personally, I don't see the need why the F8 key should enter the Haiku boot loader; it didn't so until recently, and it wouldn't hurt anyone to remove that option again.

comment:22 by axeld, 10 years ago

Removed the F8 and F12 keys in hrev36233 again.

Note: See TracTickets for help on using tickets.