Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kboot status report for 2023 Q2 #202

Closed
wants to merge 11 commits into from
Closed

Conversation

bsdimp
Copy link
Member

@bsdimp bsdimp commented Jul 7, 2023

oh, and a little before too, but this is my first one

grahamperrin

This comment was marked as resolved.

@bsdimp
Copy link
Member Author

bsdimp commented Jul 8, 2023

Since I'm not selling anything, I don't need r or tm. I don't want to imply I'm selling anything by using them. The other comments look good and I'll likely include them all...

@grahamperrin

This comment was marked as outdated.

Copy link
Member

@lsalvadore lsalvadore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your report. I made a few suggestions too and I have also spotted a few typos.


The old Sony Playstation 3 port used a boot loader called 'kboot' to accomplish this in that environment.
That code has been greatly expanded, made generic with easily replaceable per-architecture plug ins.
The normal FreeBSD /boot/loader is built as a Linux binary that reads in the FreeBSD kernel, modules and tunables.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably better to use the filename markup here:

[.filename]#/boot/loader#

This comment was marked as resolved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cross-reference https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266881#c3 re: discovery of markup such as this.

For UEFI enabled systems, it passes the UEFI memory table, and pointer to UEFI runtime services to the new kernel.

It supports loading files from the host's filesystem, from any loader(8) supported filesystem on the host's block devices (including ZPOOLS that span multiple devices), from ram disk images and from files downloaded over the network.
Any mix of these is available, so configuraiton overrides can be loaded from the host's filesystem, but the kernel can be loaded from dedicated storage (say NVME) or a ram disk image.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/configuraiton/configuration/

This comment was marked as outdated.

It supports loading files from the host's filesystem, from any loader(8) supported filesystem on the host's block devices (including ZPOOLS that span multiple devices), from ram disk images and from files downloaded over the network.
Any mix of these is available, so configuraiton overrides can be loaded from the host's filesystem, but the kernel can be loaded from dedicated storage (say NVME) or a ram disk image.
It supports a host console running over stdin/stdout.
It supports explicit locations like `/dev/nvme0ns1:/boot/loader/gerbil.conf` to be explicit about where to load filesystems from.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[.filename]#/dev/nvme0ns1:/boot/loader/gerbil.conf#

This comment was marked as resolved.

Copy link
Member Author

@bsdimp bsdimp Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

close enough to real filename, but only in the context of the boot loader. And only the new kboot loader.
So I'm unsure what to do with this advice.

It supports explicit locations like `/dev/nvme0ns1:/boot/loader/gerbil.conf` to be explicit about where to load filesystems from.
If supports ZFS boot environments, including the boot-once feature.

FreeBSD/aarch64 now can boot from Linux in a LinuxBoot environment, with comparable support and functionality as loader.efi.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[.filename]#loader.efi#

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

went with @grahamperrin 's suggestion instead that he linked.


FreBSD/amd64 in progress, maybe 80% done.
The amd64 boot environment has more quirks and details to get right than the aarch64 environment given its much older lineage.
The kernel boots part way before panicing because things aren't setup correctly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure about "panicing". Maybe it should be "panicking"?

This comment was marked as outdated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The kernel panics partway through initialization since	all the	prerequisites from the boot loader have	not been discovered and	implemented.


Help needed:

1. Currently, there is no documentation on how to use loader.kboot, nor on how to create test images.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[.filename]#loader.kboot#

This comment was marked as outdated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this with

 1. man:loader.kboot[8]	needs to be written. It	should document	how to use loader.kboot, how to	create images, and the different use cases that	work today.

1. Currently, there is no documentation on how to use loader.kboot, nor on how to create test images.
1. Finish amd64 support.
1. The current elf arch-specific metadata code is copied from efi. +
Unifying the kboot eand efi copies is needed. +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/eand/and/

This comment was marked as resolved.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

1. Finish amd64 support.
1. The current elf arch-specific metadata code is copied from efi. +
Unifying the kboot eand efi copies is needed. +
This is complicated because they aren't identical.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please do not use contractions:
s/aren't/are not/

This comment was marked as outdated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reworded as

 1. The current elf arch-specific metadata code is copied from efi. +
Unifying the kboot and efi copies is needed. +
While they are mostly the same, compile-time differences remain that	complicate sharing. +
In addtion, the build infrastructure makes sharing awkward.

grahamperrin

This comment was marked as resolved.

Sponsored by:		Netflix
@bsdimp
Copy link
Member Author

bsdimp commented Jul 10, 2023

pushed update that I claim addresses all the feedback here.
Please let me know if I missed anything (I tried to include it all, except trademarks, etc since any such trademark used is done in a descriptive way referring to a family of products, not one specific one, in ways that would be hard to construe as endorsement).
I've also tweaked some overly verbose and passive language
Plus rebase and squash (apologies to all if all my 'accept' generated insane spam)

Copy link
Contributor

@grahamperrin grahamperrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks,

#202 (comment)

… Please let me know if I missed anything …

One typo (kenrel), so I took the opportunity to speed-read the whole thing with fresh eyes.

Take only what you want from the suggested changes, no need to explain any discards (unless you want to).

… if all my 'accept' generated insane spam)

It's a neat feature, I never thought of it as spammy :-)

It places them into memory as if it were running in a pre-boot environment and then loads that image into the Linux kernel with man:kexec_load[2] and does a special reboot to that kernel image.
For UEFI enabled systems, it passes the UEFI memory table, and pointer to UEFI runtime services to the new kernel.

It supports loading files from the host's filesystem, from any man:loader[8]-supported filesystem on the host's block devices (including pools that span multiple devices), from ram disk images and from files downloaded over the network.
Copy link
Contributor

@grahamperrin grahamperrin Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
It supports loading files from the host's filesystem, from any man:loader[8]-supported filesystem on the host's block devices (including pools that span multiple devices), from ram disk images and from files downloaded over the network.
It supports loading files from the local filesystem, from any man:loader[8]-supported filesystem on the host's block devices (including pools that span multiple devices), from ram disk images, and from remote filesystems.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your change. but would say 'from the network' rather than 'from networked files'. Comments?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Suggestion revised. Have I twisted the meaning?

The amd64 boot environment places more requirements on the boot loader to provide data for the kenrel than aarch64 due to amd64 being an older port.
All sources for data in the BIOS enviornment had to be provided by the boot loader since the kernel had no access to them from long mode.
While UEFI and ACPI provide ways for the kernel to get this data, much of the data must still be provided by the boot loader.
The kernel panics during initialization since all these prerequisites have not been discovered and implemented.
Copy link
Contributor

@grahamperrin grahamperrin Jul 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The kernel panics during initialization since all these prerequisites have not been discovered and implemented.
[.filename]#loader.kboot# does not yet implement the entire amd64 boot protocol, so the kernel still panics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

Loader.kboot does not yet implement the entire amd64 boot protocol, so the kernel still panics.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion revised, NB:

  • lowercase l
  • [.filename]#⋯# markup seems reasonable here.

@bsdimp
Copy link
Member Author

bsdimp commented Jul 10, 2023

Accepted all but two. What do you think of my suggested changes to your suggested change ... If you like them, just make them a suggestion and I'll accept it. If not, we'll chat :)

Copy link
Contributor

@pauamma pauamma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spelling and punctuation nits.

Comment on lines +16 to +17
The normal FreeBSD [.filename]#/boot/loader# is built as a Linux binary that reads in the FreeBSD kernel, modules and tunables.
It places them into memory as if it were running in a pre-boot environment, then loads that image into the Linux kernel with man:kexec_load[2] and does a special reboot to that image.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The normal FreeBSD [.filename]#/boot/loader# is built as a Linux binary that reads in the FreeBSD kernel, modules and tunables.
It places them into memory as if it were running in a pre-boot environment, then loads that image into the Linux kernel with man:kexec_load[2] and does a special reboot to that image.
The normal FreeBSD [.filename]#/boot/loader# is built as a Linux binary that reads in the FreeBSD kernel, modules, and tunables.
LinuxBoot places the FreeBSD kernel, modules, and tunables into memory as if it were running in a pre-boot environment, then loads that image into the Linux kernel with man:kexec_load[2] and performs a special reboot to the image.

Disambiguate the words 'It' and 'them' … correct, or have I misunderstood?

(I might be slaving over this unnecessarily; the report acknowledges the need for a manual page.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as if loader.kboot were running as loader.efi and trying to load the kernel, tuneables and modules from there (similar memory layouts happen). I struggled with a way to say loader.kboot will present the same environment to the kernel's startup code after loader.kboot does its kexec that loader.efi does after loading everything and jumping to the kernel's startup code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

… I struggled with a way to say …

How about … a freehand sketch? (As if you have nothing better to do.)

It needn't be perfect; the absence of loader.kboot(8) is uppermost amongst your pleas for help.

File an image somewhere under /home/imp/public_html then it can be linked from within the report. Just a thought.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If an image is to be included, please remember that the report will also be sent by email. So either we include a link reference or maybe a picture in Ascii art.

But a good wording is probably better.

Copy link
Member

@lsalvadore lsalvadore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have found two last minute small issues.
I think we can finally merge this report, is anything still missing?


Help needed:

1. man:loader.kboot[8] needs to be written. It should document how to use [.filename]#loader.kboot#, how to create images, and the use cases that work today.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. man:loader.kboot[8] needs to be written. It should document how to use [.filename]#loader.kboot#, how to create images, and the use cases that work today.
1. man:loader.kboot[8] needs to be written.
It should document how to use [.filename]#loader.kboot#, how to create images, and the use cases that work today.

One sentence per line please, even in list elements.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rolled into (superseded by) #202 (comment)

Unifying the kboot and efi copies is needed. +
While they are mostly the same, sharing is complicated by remaining compile-time differences. +
In addtion, the build infrastructure makes sharing awkward.
1. It would be nice to add riscv64 support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. It would be nice to add riscv64 support
1. It would be nice to add riscv64 support.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rolled into (superseded by) #202 (comment)

@grahamperrin
Copy link
Contributor

is anything still missing?

At a glance, at least:

  1. substantially, kboot status report for 2023 Q2 #202 (comment), which, as revised, is Warner's suggestion
  2. nelgigibly, where kboot status report for 2023 Q2 #202 (comment) begins to pay attention to an ordered list, now I can see a leading white space at each number.

https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#lists example 31 presents what's below the lead for a simple ordered list:

.

Comment on lines +46 to +49
1. The current elf arch-specific metadata code is copied from efi. +
Unifying the kboot and efi copies is needed. +
While they are mostly the same, sharing is complicated by remaining compile-time differences. +
In addtion, the build infrastructure makes sharing awkward.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the hardness + of line breaks intentional?

Previewed:

image

PowerPC builds, but nothing more of its state is known.
Attempts to acquire a suitable Playstation 3 proved to be too time consuming for the author.

Help needed:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Help needed:
==== Help Needed
  • a simple subheading
  • and then, what's currently an ordered list of numbered items can become an unnumbered series of simple paragraphs.

The final paragraph, sponsorship already in place, will not be misinterpreted as something with which you need help.

@lsalvadore
Copy link
Member

Thanks @bsdimp, @grahamperrin and @pauamma for your efforts to put in place a high quality report.

Do you think you can complete the last few things you need in the next few days? It is already late July, I would like to publish the status report within August 15th, or even better within the end of the month. It does not matter if it is not perfect, as long as the content is there.

If you do not have time and you want me to make the merge and fix any last minute thing, please just ask.

@bsdimp
Copy link
Member Author

bsdimp commented Jul 23, 2023

I thought that Iwas done. what's left?

@bsdimp
Copy link
Member Author

bsdimp commented Jul 23, 2023

oh, I see. The last few suggestions are fine: the hard breaks aren't intentional and the new section is fine. I don't have time to revise and repush, thought.

Copy link
Contributor

@grahamperrin grahamperrin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: #202 (comment)

… repush …

If it simplifies things:

  1. the two-click routine for each acceptable suggestion, then
  2. https://patch-diff.githubusercontent.com/raw/freebsd/freebsd-doc/pull/202.diff should be ready for Lorenzo to push (if everything that's required existed as a suggested change for step 1).

Comment on lines +44 to +53
1. man:loader.kboot[8] needs to be written. It should document how to use [.filename]#loader.kboot#, how to create images, and the use cases that work today.
1. Finish amd64 support.
1. The current elf arch-specific metadata code is copied from efi. +
Unifying the kboot and efi copies is needed. +
While they are mostly the same, sharing is complicated by remaining compile-time differences. +
In addtion, the build infrastructure makes sharing awkward.
1. It would be nice to add riscv64 support
1. PowerPC testing (it has been untested since the refactoring started).
1. Creating a script to repackage EDK-II image (say, from QEMU) as a linux-boot image with a Linux kernel built on FreeBSD for CI testing.
1. Testing it from the coreboot LinuxBoot.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. man:loader.kboot[8] needs to be written. It should document how to use [.filename]#loader.kboot#, how to create images, and the use cases that work today.
1. Finish amd64 support.
1. The current elf arch-specific metadata code is copied from efi. +
Unifying the kboot and efi copies is needed. +
While they are mostly the same, sharing is complicated by remaining compile-time differences. +
In addtion, the build infrastructure makes sharing awkward.
1. It would be nice to add riscv64 support
1. PowerPC testing (it has been untested since the refactoring started).
1. Creating a script to repackage EDK-II image (say, from QEMU) as a linux-boot image with a Linux kernel built on FreeBSD for CI testing.
1. Testing it from the coreboot LinuxBoot.
man:loader.kboot[8] needs to be written.
It should document how to use [.filename]#loader.kboot#, how to create images, and the use cases that work today.
Finish amd64 support.
The current elf arch-specific metadata code is copied from efi.
Unifying the kboot and efi copies is needed.
While they are mostly the same, sharing is complicated by remaining compile-time differences.
In addtion, the build infrastructure makes sharing awkward.
It would be nice to add riscv64 support.
PowerPC testing (it has been untested since the refactoring started).
Creating a script to repackage EDK-II image (say, from QEMU) as a linux-boot image with a Linux kernel built on FreeBSD for CI testing.
Testing it from the coreboot LinuxBoot.

@grahamperrin
Copy link
Contributor

grahamperrin commented Jul 24, 2023

My recent question to FreeBSD Git administrators <[email protected]> and FreeBSD Documentation Engineering Team <[email protected]> (addressees invisible at https://lists.freebsd.org/archives/freebsd-doc/2023-July/004013.html) was partly for people to learn whether a maintainer can perform actions such as:

  • clicking to accept a change that uses the suggested change feature of GitHub.

GitHub: allow edits by maintainers

freebsd-git pushed a commit that referenced this pull request Jul 25, 2023
Reviewed by:	grahamperrin, status (Pau Amma <[email protected]>)
Approved by:	carlavilla (mentor, implicit)
Pull Request:	#202
@lsalvadore
Copy link
Member

Merged, thanks.

I did my best to include the last minute changes that you agreed. If I misunderstood ot forgot something, please feel free to fix it, even without review (the month is coming to an end and I would like to speed things up to ensure the report is published within it).

I will close the PR as soon as I have access to a computer: for some reason, the GitHub app does not allow me to close PRs on my smartphone...

@sergio-carlavilla
Copy link
Contributor

Merged.

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

Successfully merging this pull request may close these issues.

5 participants