Page MenuHomeFreeBSD

kboot: move to generic syscall interface
ClosedPublic

Authored by imp on Dec 16 2021, 5:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 10:54 AM
Unknown Object (File)
Tue, Apr 9, 2:56 PM
Unknown Object (File)
Wed, Apr 3, 3:05 PM
Unknown Object (File)
Mar 19 2024, 2:20 AM
Unknown Object (File)
Mar 18 2024, 10:05 PM
Unknown Object (File)
Mar 14 2024, 11:39 PM
Unknown Object (File)
Mar 14 2024, 11:39 PM
Unknown Object (File)
Mar 14 2024, 11:36 PM
Subscribers

Details

Summary

Just have the MD code provide syscall and have generic code for the
rest.

Sponsored by: Netflix

Test Plan

This commit is the one I'm most worried about

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp requested review of this revision.Dec 16 2021, 5:00 PM
stand/kboot/arch/powerpc64/host_syscall.S
18

'so' flag is used by the syscall interface, on FreeBSD too, to denote error. Examining uses of host_open(), I'm guessing that 0 is already a taken file descriptor (stdin?), so returning 0 on error is acceptable. Not sure why host_read() would return 0 on error. I would expect -1 instead.

imp marked an inline comment as done.Dec 22 2021, 5:20 AM
imp added inline comments.
stand/kboot/arch/powerpc64/host_syscall.S
18

Yea. It's weird. And these are Linux calls, so a negative errno is expected...

And looking at how it's used, an error in open would translate to reading stdin given how open is used. So I'm guessing there were no such errors.

Likewise for reads.... But why is that code even there...

I was able to build kboot for powerpc64, with diffs D33511 - D33515.
In the machines that I have access to, Petitboot can't run BE loader.kboot, but I was able to build and run a LE loader.kboot.
However, as mentioned in D33511, it can just run some loader commands, but can't list files or load a kernel. But the older version, without these changes, also can't.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 30 2021, 11:32 PM
This revision was automatically updated to reflect the committed changes.
imp marked an inline comment as done.