#
…

2022-02-01

01:16yrlf has quit [Quit: Ping timeout (120 seconds)]
01:17yrlf has joined #asahi-dev
01:17nsklaus has quit [Read error: Connection reset by peer]
01:18nsklaus has joined #asahi-dev
01:18gabuscus has quit [Remote host closed the connection]
01:20gabuscus has joined #asahi-dev
01:20suricato_ has quit [Remote host closed the connection]
01:20suricato has joined #asahi-dev
01:37alyssapovik: Gah, no audio this boot
01:38alyssasame symptom
01:38alyssa[ 1.121952] cs42l42 2-0048: Get Revision ID failed
01:38alyssa[ 1.133647] cs42l42: probe of 2-0048 failed with error -61
02:12V_ has quit [Remote host closed the connection]
02:32yuyichao has joined #asahi-dev
03:00V has joined #asahi-dev
03:06PhilippvK has joined #asahi-dev
03:09phiologe has quit [Ping timeout: 480 seconds]
04:03phiologe has joined #asahi-dev
04:04kov has quit [Quit: Coyote finally caught me]
04:06PhilippvK has quit [Ping timeout: 480 seconds]
04:10kov has joined #asahi-dev
05:08marcanI'm wondering if our tipd curse extends to i2c in general or what
05:20chadmed has quit [Read error: Connection reset by peer]
05:34chadmed has joined #asahi-dev
06:10jeffmiw has joined #asahi-dev
06:17jeffmiwwhat are the "/bits/" branches on github/asahi/linux used for ? shall I create one to share my spmi/pmu/rtc drivers ? or shall just create my branch of asahi one ?
06:33the_lanetly_052___ has joined #asahi-dev
07:23jeffmiw has quit [Ping timeout: 480 seconds]
07:25MajorBiscuit has joined #asahi-dev
07:43kloenkI think I'm still not sure how to do fat. Where to read files from? direct nvme? Where should the file be stored/which name? What should I do with the file after verifying it?
08:00_jannau_kloenk: you're too fast so the infrastructure is not there. I suppose the installer will embed a config payload which will specify a GPT partition UUID of the matched EFI system partition
08:01kloenkok, hoped I could already do something
08:03_jannau_the second stage m1n1 should be read from that partition. After verification it will be loaded by the active m1n1 in a similar fashion as the proxy chainlaod
08:04_jannau_I suppose you could start testing by creating a ESP partition and hardcode it's start and end sector
08:07Major_Biscuit has joined #asahi-dev
08:08kloenkSadly I only have my main mac, on which I'm very very dependend, so can only write theoreical code :)
08:13_jannau_you could check if there's a useable gpt partition crate. we only need read support
08:14MajorBiscuit has quit [Ping timeout: 480 seconds]
08:14_jannau_as first step it would be fine if it uses the first EFI system partition
08:17povikmarcan: saw the github issue and i am wondering the same
08:20kloenkDoesn't look like there is a usable gpt crate. all I found wanted to use std
08:22Jamie[m]1gpt and gptman both use the Read/Write traits
08:25the_lanetly_052__ has joined #asahi-dev
08:28kloenkmaybe I will just write a new gpt libary with a friend together
08:31the_lanetly_052___ has quit [Ping timeout: 480 seconds]
08:40_jannau_not sure if there strong security advantage of doing the limited gpt parsing we need in rust. one argument for rust would be that all nvme data proecessing code is in rust
08:42kloenkYes, parsing the table in C, and just giving rust the starting address should also work. Will have to think about it
08:47_jannau_I guess you could just reuse the read part of one of the existing crates and read replace the io with what you're doing in the fat code
08:48marcanGPT is trivial anyway, shouldn't be a problem to implement in Rust
08:58j`eykloenk: another option for vendoring is a git dependency, to avoid the full `cargo vendor` route
09:07kettenismarcan: I have seen some issues with reading back registers from the tas5770 codec immediately after writing to them (in OpenBSD)
09:09kettenisbut just reading the cs42l83 revision register seems to work reliably for me
09:10kloenk[j"ey](https://matrix.to/#/@irc_oftc_j=60ey:petabyte.dev): yeah, but I favour the "cargo vender` route, as vendor cleans the crates, we don't need the CI configurations and stuff like that from the dependencies
09:10kloenkand matrix<->irc bridge creates funny texts again :)
09:25Major_Biscuit has quit []
09:27MajorBiscuit has joined #asahi-dev
10:02kloenkThe thing that is blocking my mind right now is how to get the size of the drive. Is this reported by nvme?
10:03j`eykloenk: I kinda don't like the vendor route, for just having a whole bunch of 'copy / pasted' code, but it doesnt reallly matter
10:05Jamie[m]1kloenk: it's in gpt (Last usable LBA)
10:05kloenkyes, just discovered that. Now reading the uefi specs :)
10:07ChaosPrincesskloenk: i also started writing a gpt parser
10:07j`eyChaosPrincess: in rust or C?
10:08kloenkChaosPrincess: mind showing it to me? I think I want to write a crate, which has std support, but as default does not use std
10:08kloenkwant to work together on it?
10:08kloenkChaosPrincess: are you on matrix? maybe we should create a new room for this
10:09j`eycan you make it an irc room?
10:09ChaosPrincessmoved to pms
10:10kloenkI don't know how to, but if someone can create it, i think it's a good idea. I want to name the crate "nogpt" (as it has no_std support)
10:13the_lanetly_052__ has quit [Ping timeout: 480 seconds]
10:18ChaosPrincesscan we just assume that the block size is 4k?
10:29povikkloenk: you don't need to create it, you can simply join #nogpt
10:38skrzyp has quit [Remote host closed the connection]
11:02svenChaosPrincess: yes, at least all M1 Pro/Max chips have a 4k block size
11:21skrzyp has joined #asahi-dev
12:02kaprests has joined #asahi-dev
13:37kloenkmarcan: I just discovered that the fat32 crate is eol. the author recomends rust-fatfs
13:43off^ has joined #asahi-dev
13:46the_lanetly_052__ has joined #asahi-dev
13:52kloenkwell core_io does not build, seems like that does not work as well
13:56kloenkmaster does build, but it's not block based. so also a pain in the ass
14:05the_lanetly_052___ has joined #asahi-dev
14:11the_lanetly_052__ has quit [Ping timeout: 480 seconds]
14:11marcankloenk: I don't particularly care about it being eol if it works
14:13DmitrySboychakov[m]nothing is bug-free, since it is eol - nothing will be fixed
14:15alyssaDmitrySboychakov[m]: it's FOSS -- if you use it and fix it yourself, congrats it's not eol anymore
14:18DmitrySboychakov[m]alyssa: that's also true :)
14:27the_lanetly_052___ has quit [Read error: Connection reset by peer]
14:39yuyichao has quit [Ping timeout: 480 seconds]
15:01yuyichao has joined #asahi-dev
15:21kloenkyeah, I think using fat32, and fixing it ourself if needed is best. but I think then it's better to at least vendor that properly as an active project, and not as a dependency
15:22ChaosPrincesskloenk: you vendored rust deps incorrectly, the version now in repo has LF line endings, while cargo expects CRLF and complains about checksums not matching
15:23kloenkoh, git did that. uff. yeah, will have to fix that
15:23kloenkfirst will continue on my nogpt library
15:24jbowen has quit [Ping timeout: 480 seconds]
15:25j`eymarcan: do you want to make #asahi-rs or #asahi-rust or something?
15:33jbowen has joined #asahi-dev
15:44bisko has joined #asahi-dev
16:27poviki tried stress-testing and doing random things with the linux pasemi i2c driver (copied out of linux, running from m1n1), but didn't see anything funny
16:27povikit was all against the cs42l part, with reads on empty addresses interspersed (because linux does that too)
16:28poviknext idea: are we resetting the i2c controller properly?
16:28povikalyssa: you have recent iboot, right?
16:28j`eypovik: what does 'empty addresses' mean?
16:28povikaddress where no device responds
16:28povikso the read attempt ends in a NACK
16:48alyssapovik: no, 11.x iBoot but that was same as you I thought
16:51ChaosPrincesskloenk: fat32 is terrible and does not expose file lenghts, im forking it
16:52kloenkCan you give me some time. I would suggest giving you access to my m1n1 fork. And then putting it there as a workspace member
16:53ChaosPrincessi will fork your repo and send a pull request when im done breaking stuff :P
16:53kloenkBut afk right now. Send my your username, and I’ll give you access as soon as possible
16:53kloenkOr like that
17:01povikalyssa: will you be testing this patch for me? https://tpaste.us/8Epg
17:01poviktpw_rules: also you may want to try this ^^
17:01povikthis disables the random i2c probing linux does
17:04poviksven: i think it may be a good idea to take on that change for i2c-pasemi-platform even if it doesn't fix anything. as the driver is only used on devicetree platforms where the i2c slave devices will be explicitly instantiated
17:06svensure, just make sure it only changes the platform driver and not the pci one and send a patch to the mailing list :)
17:06povikyeah, okay then
17:23povikhere it is in commit: https://tpaste.us/r6l1 (how rude of me to send plain patches)
17:44ChaosPrincessfor chainloads, what signature/hash algorithm are we gonna use?
17:47kettenised25519 was mentioned
17:48ketteniswhich happens to be what OpenBSD's signify tool uses as well
17:48kloenkthat exact library?
17:48kettenis(ed25519 I mean, not the rust implementation)
17:49kloenkah yeah, think nixos uses it as well. I use it for ssh
17:49kettenissignify uses its own implementation that is derived from djb's public domain implementation
17:51ChaosPrincessso, lets say /m1n1.bin containing the code to chainload, and /m1n1.sig containing the result of Signature::to_bytes from that library?
17:51kloenkNot sure yet. we could also include the signature in the bin file
17:52kettenisyou typically sign the hash
17:53kettenisso that's what /m1n1.sig would be
17:54ChaosPrincessyea, the library does the hashing itself
17:54kettenisto verify you verify that /m1n1.sig was signed with the appropriate key and then you check that the hash for the loaded /m1n1.bin matches the signed hash
17:57kettenissignify uses sha256 as the hash, but these days you can probably do better
17:58svenfor a proof of concept m1n1.sig plus whatever that library uses by default sounds reasonable to me
18:03MajorBiscuit has quit [Ping timeout: 480 seconds]
18:08MajorBiscuit has joined #asahi-dev
18:25MajorBiscuit has quit [Ping timeout: 480 seconds]
18:37ChaosPrincesskloenk: mind reviewing https://github.com/WhatAmISupposedToPutHere/m1n1 and telling if it looks okay?
18:37kloenkyes, in a sec
18:51kloenkDoes m1n1 have gui? (Asking because what should happen if one of the two gpt headers are broken)
18:51ChaosPrincessyou can write to a screen console, but no kb/mouse/usb support
18:52kloenkThe spec only says it has to print a warning, not that user entry is required to fix a gpt header
18:52ChaosPrincesswe arent fixing gpt from m1n1, thats the os job
18:52kloenk> Software should ask a user for confirmation before restoring the primary GPT and must report whenever it does modify the media to restore a GPT.
18:52kloenkokay, it would be quite easy though :)
18:54svenwe should never modify the disk from m1n1
18:54kloenkyeah, fair point
18:55sventhis should all be as simple and as dumb as possible. If something doesn’t work out just bail and don’t chainload anything and continue as if there was no m1n1.bin on the disk
18:56kloenkChaosPrincess: Maybe then you should BlockDevice's write with a direct error, so it's completely forbidden
18:56kloenk*replace
18:56svenI mean… there no nvme_write anyway :D
18:57j`eyand read should return an error, not panic if the buffer is too small
18:57kloenkoh yeah, looked at a different ipml :)
18:57ChaosPrincessj`ey: arguably, that's programmer error and i think rust stdlib panics in those cases
18:57kloenkyes, plan to implement it. The current commit is more or less WIP, I'm building a dedicated GPT library, that also verifies the second header
18:59j`eyChaosPrincess: then: assert!(buf.len() >= number_of_blocks * BLOCK_SIZE);
19:40m6wiq has joined #asahi-dev
19:42___nick___ has joined #asahi-dev
19:43m6wiq1 has joined #asahi-dev
19:43m6wiq1 has quit [Remote host closed the connection]
19:43___nick___ has quit []
19:43m6wiq1 has joined #asahi-dev
19:43m6wiq1 has quit []
19:44___nick___ has joined #asahi-dev
19:49m6wiq has quit [Ping timeout: 480 seconds]
20:04m6wiq has joined #asahi-dev
20:32m6wiq has quit []
20:51jeffmiw has joined #asahi-dev
21:07___nick___ has quit [Ping timeout: 480 seconds]
21:09m6wiq has joined #asahi-dev
21:37m6wiq has quit []
21:42jbowen_ has joined #asahi-dev
21:48jbowen has quit [Ping timeout: 480 seconds]
21:50jbowen_ has quit [Ping timeout: 480 seconds]
22:21MajorBiscuit has joined #asahi-dev
22:32MajorBiscuit has quit [Ping timeout: 480 seconds]
22:41MajorBiscuit has joined #asahi-dev
23:15MajorBiscuit has quit [Ping timeout: 480 seconds]
23:57yuyichao has quit [Ping timeout: 480 seconds]
…