Page MenuHomeFreeBSD

loader: create bio_alloc and bio_free for bios bounce buffer
ClosedPublic

Authored by tsoome on Sep 12 2018, 12:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 6 2024, 12:35 AM
Unknown Object (File)
Jan 6 2024, 12:35 AM
Unknown Object (File)
Jan 6 2024, 12:35 AM
Unknown Object (File)
Jan 6 2024, 12:35 AM
Unknown Object (File)
Jan 6 2024, 12:35 AM
Unknown Object (File)
Jan 6 2024, 12:34 AM
Unknown Object (File)
Jan 6 2024, 12:22 AM
Unknown Object (File)
Dec 28 2023, 9:22 AM
Subscribers

Details

Summary

We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement
bio_alloc()/bio_free() interface to make it possible to use this space for
other BIOS calls (notably, from biosdisk.c).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19540
Build 19127: arc lint + arc unit

Event Timeline

BIO_BUFFER_SIZE is defined in libi386.h

Generally I like this, but it also looks like there's some drive reset retry logic tossed in as well...

In D17131#365407, @imp wrote:

Generally I like this, but it also looks like there's some drive reset retry logic tossed in as well...

yes, it is not clean current below this patch - I had D11174 below. I can rebase on current but I would rather keep my own order or I will mix fbsd and illumos up at some point:D

Couple of minor nits, but otherwise looks OK.

stand/i386/libi386/biosdisk.c
263–264

speaking of which...

We are getting pretty big with all the crazy new features. Is there a reliable way to tell the largest bootable image since it must all fit <= 640k? I run into trouble in the mid 500's...

531–532

you said 16k above? Is that still right or ???

tsoome added inline comments.
stand/i386/libi386/biosdisk.c
263–264

not really.

The fundamental issue (and also way out in a sense) is the memory layout.

The BTX is at 0x9000, loader is starting at 0xa000 - thats code + data + bss. We get the memory size from 0x413 (2 bytes, in pages), and thats basically our initial stack pointer. Since the BDA is variable, we have no way to know ahead how much space we have for sure.

However, our stack does not have to be in low memory, we could set it just below the heap too - but that means we wont provide stack variables for BIOS calls. Not too hard to clean up.

531–532

Thats the 1 page from current setup. There is one page in between BTX data areas we are using. if somehow we end up the "bio" area exhausted, this is our fallback. I'd expect it never happen, but ...

Update the comment about alloc/free ordering.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 30 2018, 9:36 AM
This revision was automatically updated to reflect the committed changes.