Commit Graph
1690 Commits
Author SHA1 Message Date
Garvit Surana 20ca03a343 merge fork/062-gpt-layout into fork/062-candidate (needs review and a Check-mode boot; revert this merge to drop it) 2026-11-26 09:35:13 +00:00
Garvit Surana ee377c3167 test(net): an address and gateway set by hand with no --dns ask the public resolvers 1.1.1.1 and 9.9.9.9 and the log says so, and one without a gateway keeps its plain failure, pinning the case where a tester's I219 install set up with stambha settings --ipv4 ... --ipv4-gateway ... stopped on 0.6.1 with Dns("updates-http.cdn-apple.com: Failed") 2026-11-26 09:34:58 +00:00
Garvit Surana 3ba1dc2226 merge fork/062-network-fixes into fork/062-candidate 2026-11-26 09:24:26 +00:00
Garvit Surana 9a0bc0b532 fix(net): ask the public resolvers 1.1.1.1 and 9.9.9.9 (2606:4700:4700::1111 and 2620:fe::fe over IPv6 alone) when the network names no DNS server or its servers give no address and no --dns is set, say whether a failed lookup's server never replied or answered SERVFAIL, NXDOMAIN or REFUSED, wait out DHCPv4 before taking IPv6 alone without a DNS server or with only a 6to4 or Teredo address, prefer IPv4 to those, and log the DHCPv4 exchange of an adapter taken on IPv6 alone, where two I219 online installs died with Dns(... Failed) or "no DNS server from DHCPv4 or IPv6 router advertisements" after 8 to 13 minutes of silent retries
The fallback is a resolver of its own beside the network's, since smoltcp
keeps at most three servers in one. It is asked once per lookup, after
the network's servers (or the 15 s wait for one) and the AAAA-then-A
retry, and each use is noted ("asking the public resolvers ... instead",
"resolved by the public resolver ..."). A --dns setting is never replaced.

smoltcp's Failed is the same for a server that never answered, one that
answered with an error code or no address, and a reply from an address it
did not ask. The stack now reads DNS replies off the wire beside it and a
failure says which: "no reply from 192.168.137.1 in 10 s to the A query",
"10.0.2.3 answered SERVFAIL with 0 answer records and no A address", or a
reply that came from another address and was dropped. The no-server text
stays as it was where no public resolver is reachable.

The address wait took a 2002:: (6to4) address that passed DAD 37 s in, with
no DNS server, and never waited for the DHCPv4 lease. IPv6 alone is now
taken at once only with a native global address and a DNS server; else at
the end of the 60 s DHCPv4 wait. Lookups ask A before AAAA when the only
global IPv6 address is 6to4 or Teredo (RFC 6724 ranks them below IPv4).
2026-11-25 17:29:59 +00:00
Garvit Surana 28fcdecbd6 fix(install): keep the disk's own GPT headers in a rewrite, but for their two checksums, accept any usable range inside the one a rewrite would lay out, name the field and its values when a header is refused, and refuse a disk whose partitions overlap, where a GPT Linux's fdisk made, its usable blocks from 1 MiB, was refused at Check on both of a tester's disks 2026-11-25 16:11:18 +00:00
Garvit Surana 20464bd756 fix(install): open a remote install image under its own step that stores the log at each wait and failure, give up before the guest after two minutes without a byte or six failed tries with a plain reason, and keep the boot processor's step watchdog on until the machine starts, where a tester's Ethernet install sat after "Setting up the Mac's hardware" for ten minutes with nothing on the screen or in the log
A Ryzen 5600X with an RTL8111H (XID 541) got its DHCP lease in 2 s and
logged the IPSW's REMOTE IMAGE line, then nothing: no RESTORE PROXY
wiring, no range line, no installer. The reads before the guest
(Store::open and prepare in Experiment::new) had no time limit and the
install's 20-try budget (about a quarter of an hour), nothing stored the
log between "Setting up the Mac's hardware" and "Starting the macOS
installer", and nothing watched: the other processors look at the boot
processor's steps only between guest slices.

- Ranges::before_guest: reads before the first bound give up after
  QUIET_BEFORE_GUEST_MS (120 s) without a byte, ATTEMPTS_BEFORE_GUEST (6)
  failed tries at one range, or a refusal no try mends, and keep the
  reason (GaveUp). A slow server that keeps sending is waited for. The
  first bound (the guest's restore host) restores the 20-try budget.
- RangeSource::waiting hears each wait before the guest; Waiting::screen
  is the step's line ("try 3/6 in 4 s, no data for 45 s").
- Each range's end is logged with its HTTP status, bytes, first byte and
  open time; a response that is not the partial range names its status.
- stela.efi: "Opening the macOS install image from Apple" is its own step.
  Before the guest each wait stores the logs when due (flush_due), each
  range line and failure stores them at once with the adapter's frame
  counts and state line (resyncs=/skipped= on a Realtek), and every 10 s
  of silence logs them. A give-up stops with "Couldn't download macOS from
  Apple: no data for 2 minutes. Check the network, or put the install
  files on the USB with stambha." and the technical error in the log.
- step_watchdog: the boot processor's counter is retired when the machine
  starts instead of when the other processors start (they stay parked and
  look at nothing before), and the image's reads run in a watched segment
  whose waits report progress, so a call that never returns stops the
  boot with a named stage. The boot processor still stops running alone
  (its dispatcher halts while idle) where it did.

The translator id, options revision 13 and bundle revision 39 are
unchanged.
2026-11-24 19:01:23 +00:00
Garvit Surana 7dfa02cb40 feat(translations): read a pack read on demand into memory in the background once the guest runs, in 2 MiB sequential reads that never queue ahead of a lookup's own read, and decode a lookup's record from that memory, behind --pack-preload on|off (on unless given), where a record only on the USB stick reached memory after its block had compiled (4 thousand of 2.7 million awaited lookups served)
What "awaited" was. A lookup never waits for the stick: a page whose key
the in-memory index holds but whose record lies only in the file is
answered Awaited, its block compiles, and the reader reads the record for a
later fetch. awaited_lookups counts those later fetches' lookups of the
same pages, not misses: a key no index holds is absent at once and never
read (113 177 distinct absent keys on 2026-11-23, none read). The records
came 60-570 ms after they were asked for, queued on a stick that runs one
command at a time behind up to 16 record reads, the writer's merge reads
and its 512 KiB writes (HOST DISK IO ..6573: 108-124 ms a command, deepest
40), 25 KB a read, and 171 919 asks were dropped as too late.

- stela-runtime translation_bulk: the preload's plan (each segment from its
  first record not read ahead, the merged one first, its records in the
  order a boot first used them), the memory it fills (Bulk: single writer,
  lock-free readers below a Release count), its reader (BulkReader: one
  read in flight, started after the record reads a lookup asked for, so a
  record's read waits behind one chunk at most), and the lookup shape the
  boot follows. FileRead moves here from the boot unchanged.
- The loader sets the memory aside within the room the pack's budget
  leaves (host_memory::bulk_bound: all the records in the file within the
  room, at most 1 GiB), so the room the window and the guest share shrinks
  by it; the descriptor follows the blobs in the handoff region.
- The engine decodes a record the preload holds in Shared::lookup and in
  the reader, waits for the preload for a record in its next two chunks,
  reads at most two records beside it, stops its own read-ahead while it
  runs, serves the writer's merge reads from it, and stops it when a merge
  retires the segments. The host core steps it with --host-core on;
  otherwise PE 0 steps it between slices at EL0.
- Logs: TRANSLATIONS background preload planned=..., installed, read=N MiB
  in M s held=... stopped=..., and at the end lookups in memory, from the
  preload and from the stick, before and after it stopped.

Records are still checked by their own trailers as they decode; the
translator id, the pack format, options revision 13 and bundle revision
39 are unchanged.

Tests: absent keys never read the stick; after a whole preload no lookup
does; a bound smaller than the pack holds its first records and reads the
rest on demand; a record damaged on the stick is refused alone; a lookup's
read runs before every later bulk read. A launch model over a fake stick
(30 MB/s, 5-50 ms a command, 16 KiB records), a first lookup every 2 ms:
on demand 0% of records in memory within 50 ms, wait p50 41 s; preloaded
in 2 MiB reads 99%, p99 23 ms. Every 0.25 ms: on demand 0%, p50 44 s;
preloaded p50 0.8 s, p99 1.7 s.
2026-11-23 16:04:42 +00:00
Garvit Surana fef7f64c96 style: format stela-boot and take Vec::contains in a ranges test, where cargo fmt and clippy's manual_contains failed on fork/build1 2026-11-23 12:01:00 +00:00
Garvit Surana cb0c21ce7d feat(translations): read the first records of a pack read on demand into memory before the guest starts, within a fourth of the room its indexes leave (at most 256 MiB) and two seconds, split the segment in the store into those records and an index of the rest read on demand, check each record as before, and log TRANSLATIONS preload, where every record of the 498 MB pack waited for a USB read on an idle PE while busy PEs compiled it 2026-11-23 10:15:58 +00:00
Garvit Surana 925e7514c4 feat(boot): say Stambha in what the boot screen shows, where its status lines, notices, stop screens and refusals named Stela and told people to run stela
The renamed text is what a person reads on the screen: status lines, GPU
and memory notices, stop reasons, the installer's disk refusals and the
commands they suggest (stambha repair, stambha log).

Boot log lines stay as they are, tags and text, since tools and people
grep them, and so do names written to disks or shown to macOS: the
"Stela macOS" GPT name, partition names, USB strings and Metal names.
2026-11-22 22:26:46 +00:00
Garvit Surana 176fcf2923 merge fork/wifi-saved: the hardware-proven Wi-Fi install fixes (32-bit DMA below 4 GiB, low DMA pool, longer range retries), macOS gets the Wi-Fi adapter, saved networks (wifi.saved) and the startup menu's Wi-Fi page (--wifi-prefer) 2026-11-22 17:53:03 +00:00
Garvit Surana 06aa8c1ea4 merge fork/trackpad: an opt-in emulated Magic Trackpad 2 fed whole precision-touchpad frames (--trackpad mt2|builtin with --input), options revision kept at 13 2026-11-22 17:52:57 +00:00
Garvit Surana f6b7c9cf90 test(net): check a remote image range's retries outlast a router restart, and read the attempt count in the failure line from ATTEMPTS, where it still said 1/7 2026-11-22 10:16:31 +00:00
Garvit Surana 58e9ac2f7a fix(net): keep retrying a remote image range for about seven and a half minutes, its waits capped at 30 s, where a Wi-Fi extender that lost power ended an install at 97 % after a minute's seven attempts 2026-11-22 10:09:14 +00:00
Garvit Surana b32fc611dd feat: cable an opt-in Magic Trackpad 2 for host precision touchpads (--trackpad mt2|builtin with --input, options revision 14): the touchpads give whole frames, the trackpad takes the hub's second port at full speed with the first pad's surface and the board's own serial, touch frames route to it, and what macOS asks of it and the pad's frame rate are logged as TRACKPAD lines, where a laptop's touchpad reached macOS only as a generic mouse; without the option every port, guest byte and log line is as it was 2026-11-21 23:31:48 +00:00
Garvit Surana ce2ee05393 perf(boot): take the install medium's read-ahead from --install-read-ahead N, four 1 MiB chunks unless it says otherwise and 0 reading the medium only when asked, through the bound alone, 1 MiB a service and 2 MiB of the image kept ahead as before the read-ahead, log the depth at boot and count the time the translation store's reads waited, so one image can measure what the read-ahead costs lookups queued behind it on a one-command USB stick, where the depth was fixed and the store reader logged only its last reads' latency 2026-11-21 22:57:59 +00:00
Garvit Surana 19a8a15ed4 test(log): read the USB's log back across the end of a ring its stream has wrapped round, asked only as markers come and after every chunk alike, at nine chunk sizes, one cutting a marker line among them, and with every marked boot written over, where only a ring that never wrapped was read back 2026-11-21 22:44:09 +00:00
Garvit Surana 63da2d761c test(restore): hold the ASR sender reading in store-sized reads to sending its Initiate reply and then the image exactly, each byte once, where the test asked only that the output end with the image, which a part sent twice would pass 2026-11-21 22:44:08 +00:00
Garvit Surana 4b7a58bee0 perf(log): read the USB's log back to its newest boot with a device-start marker in time and copies linear in the bytes read, asking whether it settled only once another boot's marker line has come, where each 64 KiB read back copied every byte before it and parsed them all again, 21 MB parsed for a 1.6 MB boot and the whole ring once a chunk for a boot that wrote over its own marker 2026-11-21 21:42:16 +00:00
Garvit Surana cfb4063082 perf(boot): read 2 MiB of the system image ahead a service, in two reads the size of the store's largest, and keep 4 MiB of it read ahead, so a service that finds the install medium read ahead moves on twice what it did, where one read took 1 MiB a service and a single 2 MiB read would be refused as a payload random read past the store's 1 MiB 2026-11-21 21:36:56 +00:00
Garvit Surana 993b10b0c0 fix(install): stop before the primary GPT is written when a write of the backup changed any of the primary's blocks, and say a plan's blocks without overflow before it is checked, where only the backup was read back before the log said the primary was as it was, and a range of no blocks, one past the last LBA or a disk no GPT uses panicked the check 2026-11-21 20:24:15 +00:00
Garvit Surana 6a14fb719d fix(install): add macOS only in free space beside a disk's partitions, check the plan against both GPT copies as Stela's own driver reads them before anything is written, keep a valid protective MBR, read every write back before the next and offer Check only, which reads the disk, says every write and writes nothing, where one key in the picker deleted a partition or erased the disk, only LBA 0-1 were compared, nothing was read back until all five writes were made and 11 bytes of the MBR changed 2026-11-21 19:43:00 +00:00
Garvit Surana a885a57b17 Merge upstream/main 140ffaf71 into fork/install for the macOS install build
The install build is the RTL8852CE Wi-Fi branch (wifi/rtw8852c-m3, 999c0d361)
with upstream's GPT slot, TRIM and 32 MiB log fixes.

One conflict, in crates/stela-boot/src/engine/network.rs (HostNetwork::open):
the Wi-Fi adapter's address wait still runs through network_link::address,
so its connection keeper's failures are retried until the cut, and upstream's
DHCP and DNS notes (Stack::take_notes) are logged after that wait, before the
keeper's retry line. This matches wifi/rtw8852c-m3-test, without its
host-check-only `pub(crate) mod security`.
2026-11-21 18:25:36 +00:00
Garvit Surana 999c0d361a fix(boot): drive a Wi-Fi adapter's wait for an address past its connection keeper's failures until its carrier wait and then the network stack's DHCP wait, now exported, have passed, as the host check drives its station, where the keeper's first failure, reaching the stack as the link's, ended the wait and gave the adapter up while the keeper's next attempt could still join 2026-11-21 16:34:10 +00:00
Tyler Smith fd44e745ac feat(log): every store writes a copy of the log's header in its first 4 KiB's last 512 bytes, which a torn header is read from and which keeps the boots a newer loader wrote when a released loader starts its own 4 MiB log over the longer file's start, where those boots were lost 2026-11-18 20:35:51 -05:00
Tyler Smith d406d42b89 fix(log): the newest lines a start reads for the last boot's end come from the smaller log an older loader started in the file too, where they read as none 2026-11-18 11:20:14 -05:00
Tyler Smith 8bad9edaae fix(log): a log file holding the smaller log an older loader started at its start is read as that log, and the next boot lays it out in the whole file in place, where the reader refused it and the boot started the file fresh, losing the older loader's boots 2026-11-18 11:08:32 -05:00
Tyler Smith d95e46dd76 fix(net): a bridged guest whose own DHCP client gets no offer or ACK within 10 s logs one line with the DISCOVERs and REQUESTs it sent, the frames, broadcasts and DHCP replies the host adapter received meanwhile and the host link, where a guest without an address left no record of its exchange 2026-11-18 04:29:42 -05:00
Tyler Smith e53cd3f6c7 fix(net): a lookup waits up to 60 s for the DHCP lease being got back after one was lost and then uses the name's cached address, and each failed lookup is logged with its cached address's family, age and usability, where a lease lost at its renewal failed the lookup at once and ended an online install 25 GB in 2026-11-18 03:40:28 -05:00
Tyler Smith ed81449da9 fix(net): a DHCP wait that ends without a lease logs the DISCOVERs and REQUESTs sent, the replies seen by type and destination, why each one of ours was not taken, the broadcast and VLAN-tagged frames seen, and each lease and lease loss is logged with its time, server, mask and router, where the log said only that no lease came 2026-11-18 03:40:28 -05:00
Promethium 5006c150e8 fix(disk): keep every partition in its GPT entry when the installer rewrites a table, where partitions after a gap or after the new one moved to other entries and were renumbered 2026-11-18 03:40:28 -05:00
Tyler Smith 07ea4e78ce fix(log): each boot's marker line in the log names its version and the firmware's clock at its start, and the machine state's names the version, where a boot whose first lines the ring had overwritten could not be told by version or date 2026-11-18 03:40:12 -05:00
Tyler Smith a6ca0295a2 fix(log): stela makes the USB's log file 32 MiB where the EFI partition keeps room for two loaders beside it, or 16 or 8, and lays a shorter one out again with its lines, and a file of 16 MiB or more keeps 384 KiB of the first lines of each of the last 16 boots, where the 4 MiB file's 3 MiB ring held under an hour of a booted desktop and its 112 KiB records cut boots whose start before macOS was longer 2026-11-18 03:40:12 -05:00
Tyler Smith 903f25fa48 fix(log): a log store that fails is tried again with the next, which writes the ring blocks it did not before the header that counts them, and a log closes only after six failed stores in a row, where one failed USB store closed the stick's log for the rest of the boot and a store after a failure left a hole of old bytes in its stream 2026-11-18 03:40:12 -05:00
Tyler Smith 1023fdf2b4 refactor(net): the guest network facts pass the Apple name check itself to the server-name test, as strict Clippy asks, where a closure wrapped it 2026-11-17 19:45:05 -05:00
Tyler Smith f805736dba fix(net): the guest network logs once a minute whether the guest's lookups of Apple's services were answered, its HTTPS connections to them accepted or reset, TLS stopped with an alert, and its clock against a time server's, where a failed Apple Account sign-in left no network fact in the log 2026-11-17 19:45:05 -05:00
Tyler Smith b2385d409b fix(net): each failed remote image range says the bytes it got, its connection's TCP or DNS state, the last byte's age and the adapter's frame counts, followed by the adapter's state, and a failed read-ahead range is logged, where a failure gave only the error and the adapter's state was logged once before any failure 2026-11-17 19:44:53 -05:00
Tyler Smith f5e927f537 fix(net): an unbounded remote image read waits out a failed range's backoff through the network's own wait, which serves the other stream's connection and the link meanwhile, where it spun for up to 32 s without a look at the network 2026-11-17 19:44:53 -05:00
Tyler Smith ae4d08eb1e fix(log): the boot log names a disk by its serial's last four characters, a MAC address by its vendor half and last byte, and the guest's and restore's ECID, UDID, serial number and computer, network and account names by short tags, and stela log tags account folders in its headings, where logs people post held whole serials, MAC addresses and Apple device identifiers 2026-11-17 19:44:53 -05:00
Tyler Smith 96adb07379 docs(log): the boot log's module text says when a record's first lines are stored and that the reader checks their marker, where it named only the store that completes them 2026-11-17 19:44:53 -05:00
Tyler Smith e4c34b46f3 fix(log): a boot writes its record's first lines only after a header names the record as its own, a failed store writes them again in the next, and the reader drops a record that does not start with its boot's marker, where a store cut before its header left an older boot's lengths over the new boot's bytes or over a converted log's moved lines, and a failed store left the header naming lines never written 2026-11-17 19:44:53 -05:00
Tyler Smith 9c8cd29bac feat(log): the boot log keeps the first and last lines of each of the last eight boots in records beside its ring and stela log writes them first with the running time its lines cover, where a running macOS overwrote every boot's first lines within an hour 2026-11-17 19:44:53 -05:00
Tyler Smith d3259b47bc fix(log): the USB input line says whether a network adapter is attached, where it printed the adapter's station address as decimal bytes that log masking misses 2026-11-16 19:31:31 -05:00
Tyler Smith 28d7edf093 fix(net): an unanswered DHCPDISCOVER is sent again after 4 s, as RFC 2131 advises, where the first one, often lost as the link comes up, was repeated only after 10 s 2026-11-16 19:31:31 -05:00
Tyler Smith ca4b1e3295 fix(net): a host network with only a unique local IPv6 address waits for its DHCPv4 lease and asks names over IPv4, where the install took the ULA at once and every range to the IPSW's global address timed out 2026-11-16 19:31:31 -05:00
Tyler Smith 9a4f70bb98 fix(net): the install's network client tries every host adapter, those with a link first, before the guest network takes one it left, where the guest took the second adapter first and an install whose cable was in it failed on the first 2026-11-16 19:31:31 -05:00
Tyler Smith 7ff304eb7e fix(display): a firmware screen showing frames a GPU with no display drew runs at its EDID's preferred rate as a GPU's display does, where the copy was held to 60 Hz and a 240 Hz monitor's guest ran at 16.7 ms frames 2026-11-16 17:10:30 -05:00
Tyler Smith 7c34ab26ea fix(display): an EDID whose base block has no detailed timing gives its DisplayID extension's preferred timing as the panel's size and refresh, where the screen kept the firmware's mode and ran at 60 Hz 2026-11-16 15:14:27 -05:00
Tyler Smith b052b90a18 fix(restore): keep a pending read's cursor when the transfers end and when other reads need a cursor, evicting free ones first, where both dropped it and the read asked again inflated its member from the start 2026-11-15 05:40:36 -05:00
Tyler Smith 7d815c7e36 fix(restore): keep what an answer read, its heads, whole images and finished digests, while its request is asked again after a pending read, so each turn goes on from the last, where every turn read every head and digested the SEP image again and NORData from a slow stick never ended 2026-11-15 05:40:36 -05:00