Bug 281494 - stand/i386/boot0: print location of string F6 PXE is not aligned
Summary: stand/i386/boot0: print location of string F6 PXE is not aligned
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: John Baldwin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-14 10:43 UTC by Tatsuki Makino
Modified: 2024-12-01 05:02 UTC (History)
2 users (show)

See Also:
jhb: mfc-stable14+
jhb: mfc-stable13+


Attachments
photo of the screen with boot0 displayed (38.25 KB, image/jpeg)
2024-09-14 10:43 UTC, Tatsuki Makino
no flags Details
proposal patch for stand/i386/boot0 (461 bytes, patch)
2024-09-14 10:44 UTC, Tatsuki Makino
no flags Details | Diff
photo of the screen with patched boot0 displayed (36.29 KB, image/jpeg)
2024-09-14 10:46 UTC, Tatsuki Makino
no flags Details
photo of the screen with "F6 PXE\r" patched boot0 displayed (34.56 KB, image/jpeg)
2024-09-21 06:05 UTC, Tatsuki Makino
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tatsuki Makino 2024-09-14 10:43:05 UTC
Created attachment 253556 [details]
photo of the screen with boot0 displayed

This is what it looks like in my environment.
Since F6 PXE is a key choice, it is assumed that there should be no blank lines between the rows of disks.
Comment 1 Tatsuki Makino 2024-09-14 10:44:32 UTC
Created attachment 253557 [details]
proposal patch for stand/i386/boot0

\n before Boot: at prompt is to create a blank line.
There, cursor is guaranteed to be on the far left, so it is omitted to print \r.
F6 line ends with \r\n, just like any other disk line.
Two spaces are needed between F6 and PXE, but there doesn't seem to be enough space to add more.
So, on the contrary, take .ascii " " from the disk row and align it.
This inserts a NOP instruction at at 0x1ad.

This will require help and auditing by the person who made the development there or the artist of 446 bytes.
Comment 2 Tatsuki Makino 2024-09-14 10:46:02 UTC
Created attachment 253558 [details]
photo of the screen with patched boot0 displayed

Here is a photo of the screen showing the patched boot0.
The display location of F6 PXE is now aligned.
I feel that this is also difficult to see due to the reduction of the gaps between the letters :)
Comment 3 John Baldwin freebsd_committer freebsd_triage 2024-09-20 14:59:48 UTC
Can we not just drop the leading '\n' from the PXE string and use that to create the double space?  That will remove the blank line before the prompt (in effect replacing it with the PXE option) but would otherwise work I think?  That is:

.ascii  "F6  PXE\r"
Comment 4 Tatsuki Makino 2024-09-21 06:05:40 UTC
Created attachment 253712 [details]
photo of the screen with "F6  PXE\r" patched boot0 displayed

(In reply to John Baldwin from comment #3)

I think that is also possible.
The layout looks like this photo.
If PXE is not defined, the F6 line is blanked.

The binary only changes the 3 bytes around this F6.

The patch is as follows.

diff --git a/stand/i386/boot0/boot0.S b/stand/i386/boot0/boot0.S
index 80c7702840c..6c48e380a32 100644
--- a/stand/i386/boot0/boot0.S
+++ b/stand/i386/boot0/boot0.S
@@ -581,7 +581,7 @@ intx13:						# Prepare CHS parameters
  */
 prompt:
 #ifdef PXE
-		.ascii "\nF6 PXE\r"
+		.ascii "F6  PXE\r"
 #endif
 		.ascii "\nBoot:"
 item:		.ascii " ";	     .byte ' '|0x80
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-09-30 19:44:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4fa4693dcdd8176f1d12cce5f026eb2052036dfc

commit 4fa4693dcdd8176f1d12cce5f026eb2052036dfc
Author:     Tatsuki Makino <tatsuki_makino@hotmail.com>
AuthorDate: 2024-09-30 19:41:42 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-09-30 19:41:42 +0000

    btx: Align the PXE prompt with other options

    To fit within in the same space, drop the newline before the PXE
    prompt to make room for the additional space character.

    PR:             281494

 stand/i386/boot0/boot0.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-12-01 04:57:51 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=09cfc202bc0521858185605edbe8d7f7f037a249

commit 09cfc202bc0521858185605edbe8d7f7f037a249
Author:     Tatsuki Makino <tatsuki_makino@hotmail.com>
AuthorDate: 2024-09-30 19:41:42 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-12-01 02:46:03 +0000

    btx: Align the PXE prompt with other options

    To fit within in the same space, drop the newline before the PXE
    prompt to make room for the additional space character.

    PR:             281494
    (cherry picked from commit 4fa4693dcdd8176f1d12cce5f026eb2052036dfc)

 stand/i386/boot0/boot0.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-12-01 04:58:53 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a845238dd609a1f18e5b80404545122f498e7f2c

commit a845238dd609a1f18e5b80404545122f498e7f2c
Author:     Tatsuki Makino <tatsuki_makino@hotmail.com>
AuthorDate: 2024-09-30 19:41:42 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-11-30 21:28:51 +0000

    btx: Align the PXE prompt with other options

    To fit within in the same space, drop the newline before the PXE
    prompt to make room for the additional space character.

    PR:             281494
    (cherry picked from commit 4fa4693dcdd8176f1d12cce5f026eb2052036dfc)

 stand/i386/boot0/boot0.S | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)