Search logs:

channel logs for 2004 - 2010 are archived at http://tunes.org/~nef/logs/old/ ·· can't be searched

#osdev2 = #osdev @ Libera from 23may2021 to present

#osdev @ OPN/FreeNode from 3apr2001 to 23may2021

all other channels are on OPN/FreeNode from 2004 to present


http://bespin.org/~qz/search/?view=1&c=osdev2&y=24&m=4&d=24

Wednesday, 24 April 2024

00:00:00 <geist> well, okay it doesn't really explain it but i'm curious
00:00:00 <geist> just never really looked into the advanced PIT modes
00:00:00 <dostoyevsky2> https://computernewb.com/wiki/QEMU/Devices/Sound_Cards <- but not sure which of those soundcards would let me play a wav file via DMA... maybe "hda/Intel HD Audio"?
00:00:00 <bslsk05> ​computernewb.com: QEMU/Devices/Sound cards - Computernewb Wiki
00:00:00 <heat> geist, btw you have a test in your printf test that doesn't seem to pass on glibc
00:01:00 <zid> what be it?
00:01:00 <heat> EXPECT_TRUE(test_printf("", "%.", input));
00:01:00 <geist> yah been a while since i ran it against glibc
00:01:00 <heat> which makes sense, this is not a valid printf
00:01:00 <zid> yea idk if that's specified
00:01:00 <heat> it's UB if you give printf a bad format specifier
00:01:00 <heat> it could validly crash
00:01:00 <zid> ah so fake news test
00:02:00 <geist> ah i must have just been testing that it didn't asplode
00:02:00 <geist> +1 AAAA would buy again
00:02:00 <mjg> [just a side note that i just found that menuet os is still active, carry on]
00:03:00 <geist> mjg: years and years ago, 2001 i and the menuet os guy wrote an article in dr dobbs each
00:03:00 <geist> it was the hobby OS edition
00:03:00 <geist> dr dobbs magazine, like physical on paper. when that existed
00:04:00 <geist> or maybe 2000
00:04:00 <geist> something in there
00:04:00 <heat> oldies!
00:05:00 <mjg> where tf is the source code
00:05:00 <geist> but yeah at the time menuet OS was one of the most developed hobby os
00:05:00 <mjg> oh uh
00:05:00 <mjg> > menuet32 is open source, menuet64 isn't.
00:05:00 <mjg> fuck it
00:05:00 <geist> my os, newos, had some traction though i mostly slowed down the next few years as i switched jobs and the openbeos guys forked it
00:06:00 <mjg> was not that around the time where bsds slowly started dying?
00:06:00 <geist> maybe a bit later, mid 2000s
00:06:00 <geist> linux was still a toy about 2000
00:06:00 <geist> didn't start getting cereal till maybe 2005?
00:06:00 <geist> 2008?
00:07:00 <mjg> i was not around to know that bit
00:07:00 <mjg> as in personally
00:07:00 <geist> i think it was somewhat zero sum: linux chewed into all the other systems
00:07:00 <mjg> i was told yahoo et al already had a linux migration plan in early 00
00:07:00 <geist> yah linux may have bee none of the first
00:08:00 <mjg> relayed by freebsd people who at the time were at y!
00:08:00 <geist> https://en.wikipedia.org/wiki/Linux_kernel_version_history acccording to this 2.6 was about 2004, which i think seems right. that may have been when it started getting solid enough to really really power server stuff
00:08:00 <FireFly> oh.. I was randomly reminded the other day of KolibriOS
00:08:00 <FireFly> apparently that was forked off of Menuet
00:08:00 <mjg> wait, i just realized, menuet os being completely in asm, means i can just disasm and get almost teh same thing as source
00:09:00 <geist> yah iirc menuetoses main claim to fame is it was written in asm and small
00:09:00 <mjg> i'm mostly curious about 1. memset et al 2. locks
00:09:00 <mjg> ofc
00:09:00 <geist> mjg: FRED
00:12:00 <mjg> KERNEL.MNT: DOS executable (COM or COMBOOT 16-bit), maybe with interrupt 22h, start instruction 0xe93e084d 656e7565
00:12:00 <mjg> how do i disasm this
00:12:00 <mjg> objdump told me to suck it
00:12:00 <mjg> i'm not gonna just hexdump
00:13:00 <dostoyevsky2> mjg: wouldn't it start with a bootsector?
00:13:00 <heat> mjg, mon
00:13:00 <heat> it's going to be pessimal
00:13:00 <geist> back in the day there was that great app... ida pro
00:13:00 <geist> it was so good for this sort of stuff
00:13:00 <heat> FOSS has radare
00:13:00 <dostoyevsky2> ghidra also
00:14:00 <geist> ah ida is still a thing
00:14:00 <Ermine> I still didn't learn radare
00:14:00 <mjg> radare? last i heard about it when i was messing with capture the flag
00:14:00 <mjg> 's gonna be 11 years
00:14:00 <geist> ida was fun because uou coudld go in there and interactively go and start naming things and moving stuff around
00:14:00 <dostoyevsky2> geist: I think there is now also a ida pro community edition or the like... but most seem to use ghidra these days
00:14:00 <heat> ghidra is my favorite thing coming from the NSA right after the copious usage of the PATRIOT act
00:14:00 <geist> and it would go and change all the references etc
00:15:00 <Ermine> heat: is it irony or not
00:15:00 <heat> i used radare to disasm my BIOS's reset vector and all the entry code
00:15:00 <heat> Ermine, i stan for the PATRIOT act obviously
00:16:00 <Ermine> I honestly can't tell for sure
00:17:00 <mjg> http://www.menuetos.net/cddl.htm they claim to run quake and doom
00:17:00 <bslsk05> ​www.menuetos.net: MenuetOS
00:17:00 <mjg> pretty impressive
00:17:00 <kof673> i thought nasm has a disassembler? .....what assembler do they use
00:17:00 <hunta987> dostoyevsky2: ida free
00:18:00 <mjg> i have to say though that the premise that writing everything in asm will result in fewer bugs is... novel
00:18:00 <dostoyevsky2> kof673: I guess for ndisasm you need to know the correct offsets...
00:18:00 <kof673> yes, not saying it is good, just if they used nasm maybe it will be better...
00:21:00 <mjg> https://github.com/marcosptf/menuetos/blob/master/menuetos-kernel-sources-32b/KERNEL.ASM#L717 :>
00:21:00 <bslsk05> ​github.com: menuetos/menuetos-kernel-sources-32b/KERNEL.ASM at master · marcosptf/menuetos · GitHub
00:21:00 <heat> Back In The Day there was a 14 year old on the forums that wrote his own os fully in asm
00:21:00 <heat> or was he 16? can't remember, doesn't matter
00:22:00 <heat> writing an OS in assembly always impressed me
00:22:00 <heat> even if the things weren't amazingly complex, just writing a program fully in asm is pretty hard
00:23:00 <mjg> https://github.com/marcosptf/menuetos/blob/master/menuetos-kernel-sources-32b/STACK.INC
00:23:00 <bslsk05> ​github.com: menuetos/menuetos-kernel-sources-32b/STACK.INC at master · marcosptf/menuetos · GitHub
00:23:00 <mjg> tcp fuckin' stack
00:23:00 <dostoyevsky2> heat: isn't is a bit more straightforward for smaller OSes? You can call the bios directly, whereas in C you awkwardly need to avoid libc
00:23:00 <nikolapdp> how do you need to avoid libc
00:23:00 <heat> you can't call the bios
00:23:00 <heat> usually
00:26:00 <Ermine> Back In The Day there were people who wrote GUI windows programs in asm by calling win32 and were very proud of it
00:26:00 <heat> was that person you?
00:26:00 <mjg> i booted the livecd, it has a chess program, but no engine
00:26:00 <mjg> bummer
00:27:00 <heat> you're in luck
00:27:00 <heat> onyx has a stockfish port
00:27:00 <heat> Somewhere(tm)
00:27:00 * kof673 points at steve gibson
00:28:00 <kof673> and randall hyde IIRC was the name of the person with "high level assembly"
00:28:00 <Ermine> no, I wasn't alive back then
00:31:00 <dostoyevsky2> https://raw.githubusercontent.com/openbsd/src/master/sys/arch/amd64/stand/cdbr/cdbr.S <- that's the first OS OpenBSD boots into... you can do print/read via `int$0x13'
00:33:00 <mjg> so i started up an irc client and connected to libera
00:33:00 <mjg> not joining this channel since it requires registered nicknames
00:33:00 <mjg> the client is a little busted
00:34:00 <dostoyevsky2> mjg: did you write your own client?
00:34:00 <mjg> i'm running menuetos here
00:34:00 <dostoyevsky2> oh
00:34:00 <mjg> created a new window for the channel i joined, but any messages i type in from *this* session land in a wrong window
00:34:00 <dostoyevsky2> mjg: they have a tcp/ip stack in it?
00:35:00 <mjg> yes, i linked it above
00:37:00 <mjg> it is eating about 20% of my cpu while idle
00:37:00 <Ermine> lol!
00:37:00 <mjg> it does not power off either
00:37:00 <mjg> you get a windows 9x-styled "it is safe to turn off your computer"
00:38:00 <dostoyevsky2> mjg: I looked it up.. neat that a working tcp/ip stack can be so small... 50K of asm
00:38:00 <mjg> all in all most impressive as a toy project
00:38:00 <mjg> utter wtf if someone wants to actually use it
00:39:00 <Ermine> I guess it means it can't into acpi
00:39:00 <kof673> that....contiki thing i think had tcp and was asm surely...
00:39:00 <geist> menuetos was also from that era when fitting a lot of shit on a floppy was a big deal
00:39:00 <geist> hence the QNX demo, etc
00:39:00 <heat> if you write an acpi aml interpreter in asm you're clinically insane
00:40:00 <dostoyevsky2> mjg: I'd like to have a small tcp/ip stack on esp32...
00:40:00 <heat> have you seen
00:40:00 <heat> uhh
00:40:00 <heat> minip?
00:40:00 <heat> wait, no
00:40:00 <kof673> i saw that qnx demo the other day...when looking at VMs that run in the browser with js/webasm/whatever...one of those had it as a sample
00:40:00 <heat> lwip!
00:40:00 <heat> minip is geist's thing built on lwip
00:40:00 <mjg> how much acpi do you need to power off?
00:41:00 <heat> zero
00:41:00 <heat> wait
00:41:00 <heat> read that wrong.
00:41:00 <heat> all of it
00:41:00 <mjg> wut?
00:41:00 <Ermine> https://wiki.osdev.org/Shutdown
00:41:00 <bslsk05> ​wiki.osdev.org: Shutdown - OSDev Wiki
00:41:00 <heat> you need to fetch a register and the value to post directly from AML
00:41:00 <heat> which requires a full blown interpreter
00:42:00 <mjg> lol fuck this
00:42:00 <heat> you may also want to set power states using ACPI. you guessed it, AML
00:42:00 <heat> want to get IRQ routings? AML!
00:43:00 <nikolar> heat: where can i find minip
00:44:00 <Ermine> Do computers have apm compatibility nowadays?
00:44:00 <heat> nikolar, https://github.com/littlekernel/lk/tree/master/lib/minip
00:44:00 <bslsk05> ​github.com: lk/lib/minip at master · littlekernel/lk · GitHub
00:44:00 <heat> Ermine, no
00:44:00 <Ermine> :(
00:44:00 <nikolar> Thanks
00:45:00 <dostoyevsky2> Ermine: automatic power management?
00:45:00 <heat> you need ACPI just to boot, there's no way you could use APM
00:45:00 <Ermine> advanced*
00:48:00 <dostoyevsky2> compared to minip and lwip this esp32 tcp/ip stack seems very tiny: https://raw.githubusercontent.com/eshkrab/esp32_tcpip/master/tcpip.c
00:49:00 <heat> that's not a tcp ip stack
00:51:00 <kof673> i...don't really want to run, because the goal is run my own stuff, but i noted dreamcast linux lets you slip or similar over serial (i do not have the lan/broadband adapter) lol
00:51:00 <kof673> that is not the software stack, but all you need for hardware lol
00:52:00 <kof673> netbsd should too, but linux had a guide lol
00:53:00 <dostoyevsky2> kof673: does it slip via the controller port?
00:53:00 <kof673> no, it has serial. i believe parallel PLIP existed too
00:53:00 <kof673> this is not surprising, just i am not that old so never saw them in use i guess ...
00:55:00 <kof673> other systems controller ports are 2-way, so i do not see why not :D
00:58:00 <dostoyevsky2> kof673: what was the serial port originally intended for on the dreamcast?
00:59:00 <kof673> possibly connecting 2 systems, i dunno ;D "accessories"
01:00:00 <kof673> i have no idea what the "dev systems" looked like if it was a leftover from that or what
01:00:00 <dostoyevsky2> kof673: like a printer... so you can proove to your mates that you got that high score
01:01:00 <geist> dreamcast also had a ethernet port accessory
01:01:00 <geist> i hacked on it years ago, it was a rtl8139 with on board 32k iirc
01:01:00 <kof673> yes, "broad band adapter" and another LAN one
01:04:00 <dostoyevsky2> geist: and with a mozilla cd for dreamcast you could browse the webosphere
01:05:00 <geist> yah i still have my old dreamcast with the BBA and keyboard and mouse
01:05:00 <geist> hacked some code on it long ago
01:14:00 <heat> okay im hacking some printk now
01:14:00 <heat> lets go
01:15:00 <geist> oh daaamn
01:15:00 <heat> how hard can a ringbuffer be
01:15:00 <heat> famous last words
01:15:00 <dostoyevsky2> when I wrote my own OS based on OpenBSD I replaced all the printk()s with one character
01:16:00 <heat> my strat is basically going to be: printk writes to a ringbuffer (with some structured-ish layout), messages are sequenced, consoles keep the last seq they saw
01:17:00 <heat> printk tries to write to the console, if trylock fails whoever releases it next will update the whole thing
01:18:00 <heat> if recursing (printk inside printk) or NMI, we write to a percpu buffer and flush it in a delayed manner
01:19:00 <heat> i think this is a sane idea
01:42:00 <geist> qemu v9.0 released
01:50:00 <geist> https://wiki.qemu.org/ChangeLog/9.0 not a tremendous amount of stuff going on, except a ton of riscv fixes
01:50:00 <bslsk05> ​wiki.qemu.org: ChangeLog/9.0 - QEMU
01:51:00 <dostoyevsky2> support for emulating apple silicon?
01:51:00 <geist> i did notice there's a cpu=max for riscv now. curious what that picks up
01:52:00 <geist> feature wise that is
01:59:00 <heat> that ztso thing
01:59:00 <heat> is it an emulation or just exposting hypervisor stuff?
01:59:00 <heat> exposing*
01:59:00 <Ermine> > future version of qemu will require kernel 4.19
02:00:00 <heat> i was actually wondering if the memory model matters at all on tcg
02:00:00 <Ermine> I guess we're getting closer to the moment when linux 4.19 will become obsolete
02:00:00 <geist> heat: i'm thinking it has to do with emulation yeah
02:00:00 <geist> basically emulating x86
02:00:00 <heat> i.e will a weak memory model be weak when emulating a weak memory model
02:00:00 <geist> https://five-embeddev.com/riscv-user-isa-manual/Priv-v1.12/ztso.html
02:01:00 <bslsk05> ​five-embeddev.com: RISC-V Instruction Set Manual, Volume I: RISC-V User-Level ISA | Five EmbedDev
02:01:00 <Ermine> > The 'virtio-blk' device has gained true multiqueue support
02:01:00 <Ermine> heat: does it need any changes on onyx side?
02:02:00 <heat> probably not
02:02:00 <heat> i don't know what true multiqueue means here
02:03:00 <heat> did it expose queues that weren't really queues? maybe? i don't know, never looked
02:03:00 <geist> i assume it lets you have multiple ring buffers, a-la nvme
02:03:00 <geist> but it may have already had that?
02:04:00 <heat> "true" here implies it had some sort of emulation-ish thing
02:04:00 <heat> i *really* don't know how qemu block IO works
02:05:00 <Ermine> There are more details in release notes
02:05:00 <geist> yah i dont know the ramifictions of the io schedulers or async stuff you can set
02:05:00 <geist> i was fiddling with proxmox and they expose all of those thigns as checkboxes
02:06:00 <heat> "different queues of a single disk can be processed by different I/O threads. This can improve scalability in cases where the guest submitted enough I/O to saturate the host CPU running a single I/O thread processing the virtio-blk requests. Multiple I/O threads can be configured using the new 'iothread-vq-mapping' property"
02:06:00 <heat> aha ok
02:07:00 <heat> does qemu use O_DIRECT
02:07:00 <geist> there are ways to set the cachability of the udnerlying file, and there's an uncached mode
02:07:00 <geist> actually is what proxmox defaults to, which is acutlaly probably not a bad idea
02:07:00 <geist> presumably that means O_DIRECT or something like that
02:08:00 <geist> iirc it's something like cached= on the device line
02:09:00 <heat> yeah
02:09:00 <heat> the guest does its own caching anyway
02:10:00 <geist> presumably the metadata portion of a qcow or whatnot is kept entirely in memory so that it's not constantly reading it back
02:10:00 <geist> but in O_DIRECT i dunno how qemu orders writes to the metdata part as it's writing otherwise
02:10:00 <geist> presumably it safely updates the table before writing new data, or whatnot
02:11:00 <geist> at some i sat down and tried to grok the qcow2 format and it does pretty much what you expect, fairly clever
02:12:00 <heat> mixing O_DIRECT and cached is risky
02:13:00 <heat> "Applications should avoid mixing O_DIRECT and normal I/O to the same file, and especially to overlapping byte regions in the same file."
02:13:00 <geist> ah yeah https://documentation.suse.com/smart/virtualization-cloud/html/virtual-disk-cache-mode-configure/index.html there's more subtle details in the modes
02:13:00 <bslsk05> ​documentation.suse.com: Configuring a Virtual Disk Cache Mode
02:14:00 <geist> based on what it does do flushes and whatnot from the guest
02:14:00 <geist> i can't find the official docs but there are a few places where basically this same blurb is put
02:19:00 <geist> heh qemu riscv 9 with cpu max enables some cpu features:
02:19:00 <geist> rv64imafdcvh_zic64b_zicbom_zicbop_zicboz_ziccamoa_ziccif_zicclsm_ziccrse_zicond_zicntr_zicsr_zifencei_zihintntl_zihintpause_zihpm_zmmul_za64rs_zaamo_zacas_zalrsc_zawrs_zfa_zfbfmin_zfh_zfhmin_zca_zcb_zcd_zba_zbb_zbc_zbkb_zbkc_zbkx_zbs_zk_zkn_zknd_zkne_zknh_zkr_zks_zksed_zksh_zkt_ztso_zvbb_zvbc_zve32f_zve64f_zve64d_zvfbfmin_zvfbfwma_zvfh_zvfhmin_zvkb_zvkg_zvkn_zvknc_zvkned_zvkng_zvknha_zvknhb_zvks_zvksc_zvksed_zvksg_zvksh_zvkt_smaia_sme
02:19:00 <geist> pmp_smstateen_ssaia_ssccptr_sscofpmf_sscounterenw_sstc_sstvala_sstvecd_svadu_svinval_svnapot_svpbmt
02:19:00 <geist> vs plain `rv64`
02:19:00 <geist> rv64imafdch_zicbom_zicboz_zicntr_zicsr_zifencei_zihintpause_zihpm_zba_zbb_zbs_sstc
02:19:00 <geist> linux doesn't seem to boot on max
02:20:00 <geist> but i bet that has to do with the smaia stuff
02:20:00 <heat> what's smaia
02:20:00 <geist> ssaia and smaia is the new interrupt controller stuff
02:20:00 <geist> AIA
02:20:00 <geist> https://github.com/riscv/riscv-aia
02:20:00 <bslsk05> ​riscv/riscv-aia - (15 forks/57 stargazers/CC-BY-4.0)
02:21:00 <heat> wasn't there another interrupt controller before AIA?
02:21:00 <heat> APLIC?
02:21:00 <geist> i think AIA encompasses APLIC, i think
02:21:00 <geist> https://github.com/riscv/riscv-aia/releases/download/1.0/riscv-interrupts-1.0.pdf lets see
02:22:00 <heat> 100 pages?!
02:22:00 <geist> ah yeah APLIC is part of it, there are other parts in the whole AIA bits, dealing with MSIs and whatnot
02:22:00 <heat> riscv is getting professional
02:22:00 <geist> oh yeah you should look at a current version of the main doc
02:22:00 <heat> priv or non-priv?
02:22:00 <geist> https://github.com/riscv/riscv-isa-manual/releases/download/riscv-isa-release-aa0572c-2024-04-24/unpriv-isa-asciidoc.pdf
02:23:00 <geist> https://github.com/riscv/riscv-isa-manual/releases/download/riscv-isa-release-aa0572c-2024-04-24/priv-isa-asciidoc.pdf
02:23:00 <geist> yeah they are a lot bigger and more complicated
02:23:00 <geist> but mostly the unpriv, sicne it is picking up more and more of the extensions as additional chapters
02:23:00 <heat> ooooh i can't believe it's not the default LaTeX theme anymore
02:23:00 <geist> exactly
02:24:00 <geist> also kinda neat, it generates an html version of it now too
02:24:00 <heat> for some reason the pdfs at https://riscv.org/technical/specifications/ are hosted on some random google drive
02:24:00 <bslsk05> ​riscv.org: Specifications – RISC-V International
02:24:00 <geist> yeah, i'm seeing more and more stuff generally do that
02:27:00 <heat> maybe riscv doesn't want to pay the egress fees for a storage bucket :v
02:28:00 <heat> this reminds me i should look at the oracle ampere thing
02:28:00 <geist> yeah i do wonder how much egress you get for free for using google drive
02:28:00 <geist> maybe i can put my toolchain tarballs over there
02:29:00 <heat> you can't wget google drive links i'm pretty sure
02:29:00 <geist> seemed to work
02:30:00 <geist> it did a 302 to a new location but it did work
02:30:00 <heat> oh yeah?
02:30:00 <heat> cool
02:30:00 <heat> the links suck and are non predictable but if it works it works
02:30:00 <geist> oh wait, duh that was the github link
02:31:00 <heat> yep doesn't work for gdrive
02:31:00 <geist> yah it gave me 90KB of javascvript
02:31:00 <heat> this reminds me, someone wrote a fuse gdrive fs :p
02:33:00 <geist> no reference to fred yet in qemu
02:34:00 <heat> you know what really pissed me off the other day?
02:34:00 <heat> i was trying to fetch your printf_tests from gitiles and it doesnt support a plain text download
02:34:00 <heat> it can only do base64
02:34:00 <heat> for some reason
02:35:00 <geist> you can probably do a direct git fetch
02:35:00 <geist> i forget the syntax but fairly sure you can just grab a blob directly from it
02:35:00 <heat> can you fetch a single file?
02:35:00 <heat> i don't keep a fuchsia repo locally anymore, it's just too damn big
02:36:00 <geist> looking
02:37:00 <geist> `git archive` may be what it is
02:38:00 <heat> isn't git archive what ppl use to make tarballs from repos?
02:38:00 <geist> yah but you might be able to spec it tight enough to grab a single file
02:39:00 <geist> oh i dunno, i give up
02:40:00 <geist> i thought there was a way, but dont see it
02:40:00 <heat> git is herd
02:41:00 <Ermine> fuse gdrive fs probably uses some api to get files
02:41:00 <geist> yah
02:45:00 <geist> oh when you're talking about my printf tests you mean the fuchsia version?
02:45:00 <geist> the LK version i should upconvert to the unittest framework
02:47:00 <heat> yep i used the fuchsia version
02:48:00 <heat> my internal kunit stuff is very similar to gtest and yours, so it just works
03:59:00 <GreaseMonkey> learnt another stupid thing about my Brio's BIOS today: it supports at least enabling the A20 line via INT 0x15 AX=0x2401 and reporting the status via AX=0x2402, but AX=0x2403 reports it as not supported. go figure.
04:00:00 <GreaseMonkey> i checked the other methods (the chipset is an i440EX), turns out both the traditional way and the <h1>FAST</h1> A20 way work fine
04:03:00 <kof673> i think my "bootloader" asm code...has optional define to force whatever method :/
04:03:00 <kof673> not that it has been tested at all on various machines
04:05:00 <geist> heh welcome to bios programming
04:08:00 <kof673> cpu stuff too: > Nexgen Nx586 implements CPUID, but not the EFLAGS.ID bit http://www.rcollins.org/ddj/Nov96/Nov96.html some cyrix chip has something like that too ;)
04:08:00 <bslsk05> ​www.rcollins.org: CPUID Algorithm Wars
04:09:00 <kof673> you have to enable it...but how do you know whether it needs enabled?
05:49:00 <kazinsal> https://arxiv.org/pdf/2404.10002.pdf
05:49:00 <kazinsal> love me a good gimmick paper
07:00:00 <geist> heat: heh i'm putting over the fuchsia printf tests and have a bunch of bugs to fix too
07:00:00 <geist> it's been expanded since the LK ones
09:25:00 * ddevault casually dumps a regex implementation into ring 0
09:25:00 <ddevault> monolithic kernels baby!
09:25:00 <nikolapdp> lol
09:29:00 <zid> ring ring, ring ring, ring ring
09:29:00 <gog> bananaphone?
09:29:00 <zid> hello, take your order?
09:30:00 <FireFly> hello, is this Joe?
09:31:00 <gog> no this is patrick
09:35:00 <ddevault> something I am learning from this fun extra OS project is to be a little bit less anal about every detail
09:35:00 <ddevault> regex would solve this problem? fuck it, throw in a regex implementation
09:36:00 <zid> I'm awful at that
09:36:00 <ddevault> helios is kind of in design hell because I nitpick every goddamn detail
09:36:00 <kazinsal> yeah, I have a quick and dirty regex parser in the kernel as well
09:36:00 <kazinsal> mostly used in the post-crash debugger "shell"
09:38:00 <gog> bytecode interpreters in ring 0 makes me itchy
09:38:00 <gog> even printf in ring0 is sketch
09:38:00 <gog> a format string is a bit of bytecode after all
09:38:00 <ddevault> given a string like "sata0a", I needed to obtain "sata", "0", and "a"
09:38:00 <ddevault> rather regex than sscanf
09:38:00 <kazinsal> my sister, let us talk about Extended Berkeley Packet Filters
09:39:00 <gog> EBPF makes me the itchiest of all
09:39:00 <ddevault> ugh
09:39:00 <gog> i know we have seccomp
09:39:00 <mjg> if that's all you do there i'm not sure you want regex
09:39:00 <kazinsal> tbh I'm not a big fan of eBPF
09:39:00 <kazinsal> simply because I think it really fucks up the unix philosophy aspect of the BPF engine
09:39:00 <kazinsal> BPF was meant to be simple enough to JIT
09:39:00 <kazinsal> eBPF is most definitely not
09:39:00 <zid> while(*p && !isdigit(*p)) p++; if(!*p) return; strtol(p); *p
09:40:00 <kazinsal> freebsd has a real nice clean two-pass BPF JIT that I will probably crib some notes from eventually
09:41:00 <GeDaMo> https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html "A Regular Expression Matcher Code by Rob Pike Exegesis by Brian Kernighan "
09:41:00 <bslsk05> ​www.cs.princeton.edu <no title>
09:41:00 <ddevault> Hare strings are unicode, not ascii/undefined
09:41:00 <ddevault> so it's a bit more involved than that
09:42:00 <ddevault> but tbh not being able to easily work with ASCII strings is maybe a design defect in Hare
09:43:00 <ddevault> it would be nice to just say "I declare that my kernel normatively only ever works with ASCII strings and turn off some guardrails so I can work with them as such"
09:45:00 * kof673 sees bslsk05 stare at helios > the Castillo pyramid [...] was designed so that [...] its ceremonial stairway was transformed into the image of a snake > at the equinoxes, the sun beams > this serpent of conjoined light and stone slithers up the stairway in spring, and down in autumn
09:46:00 <nikolar> ddevault can't you just cast them to a byte array
09:46:00 <ddevault> yeah
09:46:00 <ddevault> but then you don't have any of the stdlib's string:: functions, like strings::index or what have you
09:47:00 <ddevault> and Hare does not have pointer arithmetic per-se, which also makes it a bit more annoying than C in some respects
09:47:00 <nikolar> I'd reimplement some of that for byte arrays
09:47:00 <ddevault> yeah, I might
09:47:00 <nikolar> Simple enough
09:47:00 <nikolar> Almost trivial to support utf8 too
09:48:00 <zid> speaking of utf8, € pls
09:48:00 <GeDaMo> https://nullprogram.com/blog/2017/10/06/
09:48:00 <bslsk05> ​nullprogram.com: A Branchless UTF-8 Decoder
09:48:00 <zid> I need a small loan of a million euroes
09:49:00 <FireFly> €foo variables when
09:49:00 <zid> GeDaMo: fuz wrote that avx one link that
09:50:00 <GeDaMo> I don't remember that one :|
09:55:00 <kof673> i believe that is the license for the other link: https://www.cs.princeton.edu/~bwk/tpop.webpage/code.html just wants > You may use this code for any purpose, as long as you leave the copyright notice and book citation attached.
09:55:00 <bslsk05> ​www.cs.princeton.edu: Code from The Practice of Programming
09:56:00 <kof673> which of course the other link does not mention :D
09:58:00 <GeDaMo> zid: this? https://github.com/simdutf/simdutf/tree/clausecker
09:58:00 <bslsk05> ​github.com: GitHub - simdutf/simdutf at clausecker
10:01:00 <zid> fuz wrote one I'm fairly sure
10:01:00 <zid> and showed it to people on stackoverflow, as he is wont to do
10:01:00 <GeDaMo> I got that from my ##asm logs :P
11:41:00 <ddevault> fine, I'll build a cross compiler
11:41:00 <ddevault> fucking gcc
11:42:00 <gog> clang clang clang clang
11:42:00 <ddevault> for all I hate gcc I'd rather use it than clang
11:43:00 <ddevault> something about clang rubs me the wrong way
11:43:00 <ddevault> perhaps I could use cproc, though...
11:47:00 <zid> crossdev -s0 -t arm-elf-none
11:47:00 <zid> easier than clang :p
11:47:00 <zid> s1*
12:18:00 <ddevault> okay, I have a noob question
12:18:00 <ddevault> never actually written C in the higher half
12:18:00 <ddevault> relocation truncated to fit: R_X86_64_32 against `.rodata'
12:18:00 <ddevault> someone know the quick fix?
12:19:00 <zid> sounds like you fucked up a pointer size
12:20:00 <ddevault> -fPIC "fixes" it, whatever
12:44:00 <netbsduser> how do your cflags and ldflags look?
12:53:00 <ddevault> (gdb) print/x $rsp
12:53:00 <ddevault> $1 = 0xffffffffc0030f1f
12:53:00 <ddevault> erm
12:55:00 <zid> how did you get an f into rsp
12:55:00 <zid> that's pretty magical
12:55:00 <ddevault> . += 65535;
12:55:00 <nikolapdp> indeed
12:55:00 <ddevault> derp
12:55:00 <nikolapdp> lol
12:55:00 <zid> oopsie
12:55:00 <zid> my mistake isalways
12:56:00 <zid> stack = .; . += 0x4000;
12:56:00 <zid> mov rsp, stack
12:56:00 <nikolapdp> heh
12:56:00 <ddevault> hah
12:58:00 <nikolapdp> how's bunnix going, ddevault
12:59:00 <ddevault> vendoring lwext4 in my kernel
12:59:00 <zid> https://64.media.tumblr.com/d51b77f0aeeb45791f0d990e8f769571/6318dd3db9bf3e5d-8b/s640x960/82be490b53f4aa9f4fa7339060fcd1d4ce8a2f7e.gif cute picture of a bnuuy
12:59:00 <ddevault> which is requiring some legwork to get C and Hare to play well in a freestanding environment
12:59:00 <nikolapdp> neat
12:59:00 <ddevault> and at the moment I'm getting a GP fault because of an unaligned stack on an SSE register load
12:59:00 <ddevault> and I am not sure why
12:59:00 <ddevault> may be a compiler bug...
12:59:00 <netbsduser> i considered butchering up lwext4 to make an instant ext4 driver but i think i found it needed big refactoring
13:00:00 <nikolapdp> which compiler then
13:00:00 <nikolapdp> hare?
13:00:00 <ddevault> it would benefit from some refactoring indeed, but it _is_ an instant ext4 driver
13:00:00 <nikolapdp> zid: what an odd bunny
13:00:00 <ddevault> yeah, hare, specifically it looks like a codegen issue with qbe
13:00:00 <zid> I don't think adding 5 to rsp in a linker scriptcounts as a compiler boog :P
13:00:00 <zid> can rust disable sse yet
13:00:00 <netbsduser> i think the last straw was that it was completely non parallel and would need a lot of work to make it so
13:00:00 <ddevault> I fixed the linker script
13:00:00 <ddevault> now there's a second bug
13:00:00 <nikolapdp> kek
13:00:00 <nikolapdp> always another
13:00:00 <ddevault> not really sure why qbe is emitting SSE instructions here in any case
13:00:00 <ddevault> maybe because this is a variadic function?
13:01:00 <ddevault> I don't actually know how that ABI works
13:01:00 <nikolapdp> what's the code
13:01:00 <ddevault> it's just a printf implementation
13:01:00 <zid> last I checked, rust code couldn't be built -mgeneral-regs-only and uefi only left the boot processor with sse enabled, so all the APs would instantly fault :D
13:01:00 <ddevault> stack is aligned properly when entering the function
13:01:00 <ddevault> but then the stack frame unaligns it
13:02:00 <zid> aligned before the call, or after?
13:02:00 <ddevault> both
13:02:00 <zid> afaik it needs to be unaligned before, but unaligned after
13:02:00 <zid> it can't be both, you push rip
13:02:00 <zid> jmp printf
13:02:00 <zid> you need to be on +8, then call needs to put it to +0
13:02:00 <ddevault> well, after the jump it's aligned on 16
13:02:00 <ddevault> nah SSE needs to be 16
13:02:00 <zid> kk
13:03:00 <ddevault> it's 8 now, which is the problem
13:03:00 <zid> yes hence +0
13:03:00 <zid> blah: sub rsp, 8; call printf
13:03:00 <ddevault> hahaha no
13:03:00 <ddevault> looking for the compiler bug
13:04:00 <zid> foound it
13:04:00 <zid> https://github.com/rust-lang/rfcs/issues/1364
13:04:00 <bslsk05> ​github.com: Float-free libcore (for embedded systems and kernel drivers, among other things) · Issue #1364 · rust-lang/rfcs · GitHub
13:04:00 <zid> 9 year old bug that you can't use rust for embed x86
13:05:00 <nikolapdp> lol are you kidding me
13:05:00 <nikolapdp> systems language my ass
13:06:00 <netbsduser> the rust as systems language is a recent claim
13:07:00 <nikolapdp> this "bug" isn't
13:07:00 <netbsduser> the language wasn't designed as one and they have mountains of technical debt to overcome to be one
13:07:00 <zid> They're dranking their own koolaid on that one
13:07:00 <netbsduser> i tried and rejected rust for some systems software (user land stuff, not kernel) because it simply couldn't cope with things like malloc() failing
13:08:00 <zid> yea that was the main contention for linux
13:08:00 <netbsduser> they want to change that but it will be a slow slog for a language that was designed for writing a web browser in, not systems software
13:08:00 <nikolapdp> didn't they accept panicing alloc into the kernel
13:09:00 <zid> I think so :/
13:09:00 <nikolapdp> lollers
13:29:00 <ddevault> how tf do variadic arguments work
13:29:00 <ddevault> how is this gcc code not hosing the stack
13:30:00 <ddevault> https://paste.sr.ht/~sircmpwn/a3388c70afa3e18dc1c9aca9d4a3ed49b80de614
13:30:00 <bslsk05> ​paste.sr.ht: paste.s — paste.sr.ht
13:39:00 <nortti> ddevault: it seems to be using the red zone for the register save area
13:39:00 <ddevault> ah
13:39:00 <ddevault> thanks
13:51:00 <zid> -muh-redzone
13:51:00 <zid> This is why if you don't use a crossie compiler you have to tack on about 40 options
13:51:00 <zid> disabling pic and pie and the redzone and using general regs only etc
13:52:00 <zid> But then your libgcc doesn't work anyway. Not a huge problem for x86_64 at least though
14:00:00 <gog> you don't need to disable pic or pie
14:00:00 <gog> in fact, they can be friends
14:00:00 <zid> yea depends, you need to do if you wanna do certain relocations and stuf though
14:00:00 <zid> the point being it's a more relaxed environment
14:01:00 * Ermine gives gog a piece of cheese
14:01:00 <zid> code written for pie can work -no-pie but code written no pie can't work pie
14:01:00 * Ermine and a piece of pie too
14:01:00 * gog is fascinated
14:01:00 <zid> fatscinated
15:02:00 <heat> nikolapdp, the kernel alloc crate does not panic
15:02:00 <heat> hth
15:02:00 <mjg> ey heat did you previously paste 𓂺
15:02:00 <heat> yes
15:02:00 <mjg> i'm saying my fonts work now
15:03:00 <heat> good 𓂺
15:03:00 <mjg> that said this is nsfw behavior
15:05:00 <heat> it's an egyptian hieroglyph
15:05:00 <ddevault> okay this isn't funny
15:05:00 <ddevault> who's fucking up my stack alignment
15:05:00 <heat> sorry :(
15:05:00 <heat> i'll realign it later don't worry
15:05:00 <mjg> ddevault: it's the cobol devs
15:06:00 <heat> the fortan users still in this channel
15:06:00 <heat> fortran
15:06:00 <heat> ddevault, what problem are you getting? userspace alreay?
15:10:00 <nortti> mjg: I resent that remark! I've never misaligned anyone else's stacks
15:10:00 <ddevault> not userspace, still kernel
15:10:00 <ddevault> SSE loads are causing GP faults
15:11:00 <ddevault> on unaligned stack addresses
15:11:00 <heat> why are you doing SSE in the kernel?
15:11:00 <ddevault> the stack pointer is aligned on 8, but should be on 16
15:11:00 <ddevault> good fucking question
15:11:00 <heat> anyway, make sure your threads' stacks are initially misaligned by 8
15:11:00 <ddevault> maybe I need a gcc flag here...
15:11:00 <ddevault> but still
15:11:00 <heat> -mgeneral-regs-only
15:11:00 <ddevault> eh, why misalign the stacks? is that really the answer?
15:11:00 <heat> yep
15:12:00 <heat> x86_64 sysv says the stack needs to be 16-byte aligned *before the call*
15:12:00 <ddevault> cause of the frame pointer?
15:12:00 <ddevault> hm
15:12:00 <ddevault> okay
15:12:00 <ddevault> yeah
15:12:00 <ddevault> I see, this makes sense
15:12:00 <heat> cause call pushes a %rip
15:12:00 <mjg> rip rip
15:12:00 <heat> and the frame pointer if there auto-aligns it
15:13:00 <mjg> if i was making a cpu i would have everything aligned to 3
15:13:00 <mjg> because fuck you
15:13:00 <heat> 9 bit bytes
15:13:00 <nortti> would it be a 24-bit CPU?
15:13:00 <nikolapdp> or 30bit?
15:13:00 <ddevault> ayy https://files.catbox.moe/ujm90l.png
15:14:00 <nikolapdp> ez
15:14:00 <nortti> you writing this one in C?
15:14:00 <ddevault> I vendored lwext4
15:14:00 <mjg> bunnix? boomer unix?
15:14:00 <ddevault> which is an ext4 driver written in C
15:14:00 <ddevault> then FFI'd it across
15:14:00 <ddevault> bunny unix :<
15:14:00 <mjg> does NOT come off that way
15:14:00 <nikolapdp> because hare right
15:14:00 <mjg> add some bunny ears in ascii art
15:14:00 <ddevault> yes
15:16:00 <heat> ddevault, does lwext4 have journalling?
15:16:00 <ddevault> yes
15:16:00 <heat> huh cool
15:17:00 <ddevault> right?
15:19:00 <heat> jbd2 journalling does not seem too hard, i've been meaning to implement it for a while
15:20:00 <mjg> stopping smoking is ez
15:20:00 <mjg> i have been meaning to do it for few years now
15:20:00 <nikolapdp> did you do it
15:20:00 <mjg> i''m gonna start after onyx get jbd2
15:21:00 <heat> will you?
15:21:00 <heat> cuz i will do it for you
15:21:00 <heat> health is important dawg
15:22:00 <mjg> lmao i don't smoke
15:22:00 <nikolapdp> lol
15:22:00 <mjg> it's a limp dick habit
15:22:00 <nikolapdp> you got us
15:22:00 <heat> kazinsal, ebpf is actually simple to JIT, it's *way* closer to a real architecture than cBPF
15:23:00 <heat> anyway i'm glad you don't smoke, now i don't have to do anything
15:24:00 <mjg> i used to smoke a pipe tho
15:24:00 <mjg> like actual pipe, not some drugs in a bong
15:24:00 <zid> when are we just making an ebpf kernel
15:24:00 <zid> little C interp for ebpf, done
15:25:00 <nikolapdp> lol good idea zid
15:25:00 <mjg> then a friend who was smoking more than me switched to cigarettes
15:25:00 <mjg> and this is where i decided to ditch the entire thing
15:26:00 <mjg> kind of a shame tho, the activity makes for a great hobby
15:27:00 <mjg> in moderation it does not pose a helath hazard anymore than any other stuff one is doing
15:29:00 <heat> the doctor visits for your crippling heart, breathing and cancer problems are really a great hobby
15:30:00 <nikolapdp> lol
15:42:00 <mjg> how much smoking do you think it is mofo
15:43:00 <mjg> well, was
15:49:00 <ddevault> there we go: https://cdn.fosstodon.org/media_attachments/files/112/326/983/259/068/616/original/6c961ff87b738a42.jpg
15:49:00 <ddevault> beautiful
15:50:00 <heat> oh is this a new thing for fosstodon?
15:50:00 <heat> mjg, mofer are you trying to defend "light" smoking?
15:50:00 <heat> do you realize how geezer you're sounding right now?
15:51:00 <ddevault> hm?
15:51:00 <ddevault> what do you mean new thing
15:52:00 <heat> oh wait, my bad
15:52:00 <heat> i mixed up fosstodon with... that conference thing you did last year
15:52:00 <mjg> heat: i defend smoking a pipe every 2 weeks
15:53:00 <mjg> heat: i don't know if that's your idea of "light smoking"
15:53:00 <mjg> or rather, would defend, if it was not for the risk of becoming a cigarette smoker
15:53:00 <mjg> like what happened to my friend
15:55:00 <heat> well that is *the* problem isn't it
15:55:00 <heat> it's highly addictive
15:56:00 <mjg> i don't know how many pipe smokers end up like that
15:56:00 <mjg> i was never tempted by cigarettes after several months of smokin'
15:58:00 <kof673> "wisdom is double-sided" -- job "xyz only loves people with wisdom" -- book of wisdom "not found on the earth of the living" -- job beware of false redefinitions of "word of wisdom" lol
15:58:00 <kof673> this is not to argue smoking either way, but illiteracy is rampant lol
15:58:00 <mjg> anyhow stern words from the generation addicted to tiktok
15:58:00 <mjg> :XX
15:59:00 <heat> i don't have a tiktok
15:59:00 <heat> i also don't smoke and i rarely drink
15:59:00 <mjg> well then it's not a common problem among genz i guess
16:00:00 <gog> i'm still having a few cigarettes a week :|
16:00:00 <nikolapdp> as a genz, i don't have tiktok either
16:00:00 <gog> i really need to just stop
16:00:00 <mjg> gog: oh?
16:00:00 <mjg> bummer
16:00:00 <gog> yeahhhh i've quit completely a few times and then a night of partying gets me back on them
16:00:00 <mjg> ye i know people who only smoke at parties
16:00:00 <gog> it's a lack of self-discipline
16:01:00 <mjg> pretty weird imo
16:01:00 <gog> i value the momentary relief from tension more than my health i guess
16:01:00 <mjg> short term satisfaction is the bane of human existence innit
16:01:00 <gog> yuuuuuup
16:02:00 <mjg> when did you start? hs?
16:02:00 <gog> yeh 16
16:02:00 <mjg> that's some millenial shit
16:02:00 <heat> like 90% of smokers i know are in a permanent struggle to stop
16:02:00 <heat> iz insane
16:02:00 <heat> dem nicotine be wildin
16:02:00 <gog> i quit after age 22 for about 7 years
16:03:00 <gog> then i've been off and on them since
16:03:00 <mjg> here is a funny story how a guy i knew in middle school(!) got found out
16:03:00 <mjg> both of his parents were smokers
16:03:00 <mjg> one day his mom was talking with some other mom how much youth is smoking today
16:03:00 <mjg> dude was passing by
16:04:00 <mjg> she was liek "lol i wonder if my son is smoking"
16:04:00 <mjg> she got close to him and sniffed him out, while dude was just coming home from a smoke break
16:04:00 <mjg> :d
16:04:00 <mjg> talk about unlucky
16:04:00 <heat> she had to be fucking oblivious, can't believe it
16:05:00 <mjg> i easily believe because their entire house smelt like an ash tray
16:05:00 <heat> smokers have a distinct smell hard to wash off
16:05:00 <mjg> did i mention both parents smoked
16:05:00 <mjg> A LOT
16:05:00 <heat> oh i guess
16:06:00 <ddevault> does anyone know of something similar to mcopy for ext4 (populate a file as an ext4 image with content)
16:06:00 <heat> mkfs.ext4 -L i think
16:06:00 <ddevault> mkfs.ext4 can create an empty ext4 system
16:06:00 <ddevault> I want to populate it with files
16:06:00 <heat> it can also create a populated ext4 fs
16:06:00 <mjg> can you use losetup?
16:06:00 <ddevault> really?
16:06:00 <mjg> root privs required
16:07:00 <ddevault> I'm looking for a non-root option
16:07:00 <heat> ah, it's -d
16:07:00 <heat> https://github.com/heatd/Onyx/blob/master/scripts/create_disk_image.sh#L101
16:07:00 <bslsk05> ​github.com: Onyx/scripts/create_disk_image.sh at master · heatd/Onyx · GitHub
16:07:00 <heat> give it a -d <directory> and it'll prefill your ext2/3/4 fs
16:07:00 <ddevault> nice, thanks
16:07:00 <heat> yw
16:08:00 <mjg> here is a better story: i had a bunch of smokers in class in high school. one of them was at the blackboard, holding a piece of chalk
16:08:00 <heat> *annoyingly* most mkfses do not have this
16:08:00 <mjg> ... like a cigarette
16:08:00 <mjg> he even tapped it few times to drop the ash
16:08:00 <mjg> the teacher pretended to not see
16:08:00 <heat> does everyone smoke in eastern europe?
16:08:00 <mjg> no
16:09:00 <mjg> there was a large windowless wall on one side of the school
16:09:00 <mjg> it was a "designaed" smoking area
16:09:00 <mjg> every smoker would go there during recess and teachers would pretend the area does not even exist
16:09:00 <mjg> even tho anyone coming in or out of the building could see people going there
16:10:00 <ddevault> works perfectly, thanks again heat
16:10:00 <heat> :)
16:39:00 <nikolar> That's a neat trick, I should do that for my fs too
16:43:00 <Bitweasil> mjg, I don't smoke cigarettes, but I do miss aspects of the "social smoker" culture. It was a solid way to meet people, and most of 'em didn't mind if you were smoking a tobacco pipe either.
16:44:00 <Bitweasil> I knew people who didn't smoke but carried a lighter regularly, just as a social lubricant to start talking to people.
18:33:00 <geist> yah, though it's a nasty habit and i'll never do it etc, it also must be kinda nice to be able to take a few minutes to go relax with something like nicotine
18:49:00 <kof673> i had a book with pictures of old computers...there was a mainframe thing in a bunker underground for military or navy...built-in ashtray :D
18:57:00 <Bitweasil> Relax, and be social.
18:58:00 <Bitweasil> It at least used to be a sort of "instant friends group" - show up, light up, and the expectation was that you were up for talking about [whatever].
18:59:00 <Ermine> heat: in eastern europe vodka is dominant (j/k)
18:59:00 <kof673> a cigarette is just a miniature hoopoe bird (black/white ash, red fire) </alchemy joke>
19:00:00 <heat> Ermine, no jk
19:00:00 <heat> the sweetest grandmas have their own fucking alcohol production
19:01:00 <Ermine> moonshine is not vodka though
19:01:00 <Bitweasil> A still would be fun. Not poisoning myself, and not getting myself into serious legal issues, discourage me from doing such things, though.
19:01:00 <Bitweasil> I'd probably just use it for fuel.
19:02:00 <GeDaMo> Alcohol is good for cleaning too :P
19:02:00 <Ermine> Don't try to clean soft touch stuff with alcohol though!
19:05:00 <heat> Ermine, moonshine is just redneck vodka isn't it
19:05:00 <Ermine> There are differences in technology
19:06:00 <Ermine> It's important
19:06:00 <Bitweasil> I'm not familiar with distilling at any serious level, all I know is "stills are a thing" and the basic physics of how they work.
19:06:00 <Ermine> If you want into eastern europe family, you need to start feeling such differences with heart
19:06:00 <Cindy> hi
19:06:00 <Cindy> i'm cleaning up some old C code
19:08:00 <Bitweasil> And... ?
19:09:00 <Cindy> i want to understand how red-black trees work
19:09:00 <Cindy> my dumbass self back then kept violating the strict aliasing rules
19:10:00 <heat> Ermine, yo mr math i need some help
19:10:00 <heat> theres this fun trick i picked up for ring buffers
19:11:00 <heat> where instead of doing e.g head = head % size you just do head++ and tail++ and then mask later
19:11:00 <heat> mask, mod, whatever you prefer
19:12:00 <Ermine> okay, that would work
19:12:00 <heat> with this trick you don't need to reserve the last element, because you can always know if head == tail mod n is full or not (if tail - head == n, it's full)
19:12:00 <heat> HOWEVER
19:13:00 <heat> i can't tell if mod 2^64 (or ^32 or whatever) is going to fuck me over in any case
19:13:00 <heat> i dont think so, but i find it hard to think this through
19:14:00 <zid> just do it on an unsigned char in simulation
19:15:00 <zid> but, it shouldn't even matter right, if you're just only allowing tail to chase
19:15:00 <Ermine> if stuff is signed, you need to avoid negative numbers
19:15:00 <zid> it will fuck up if you allow tail++s to pend
19:16:00 <zid> but if it's just "tail can never exceed head" then you can let it wrap however it wants
19:16:00 <Ermine> because cpus don't mod correctly negative numbers
19:19:00 <heat> no signedness, signed overflow is UB even
19:22:00 <zid> heat: long as they don't get out of sync you don't have to care about wrapping unless you try to calculate 'how full'
19:22:00 <zid> if head wraps at 4 billion, tail will also wrap at 4 billion etc, if the only check you ever do is if(tail == head) full(); then nothing cares
19:22:00 <Bitweasil> Assuming nothing stupid happens during operation. :) I've invented a long list of clever ways to subtly screw up ringbuffers...
19:22:00 <heat> in this case i do need to check how full
19:23:00 <zid> be careful on the math then
19:23:00 <zid> like, if(head - tail > head) case
19:24:00 <Ermine> heat: there are some builtins for that
19:48:00 <nikolapdp> K E R N A L
19:53:00 <GeDaMo> https://www.tomshardware.com/pc-components/cpus/intel-cpu-dispensing-vending-machine-game-spotted-in-japan-one-user-got-a-core-i7-8700-for-dollar3
19:53:00 <bslsk05> ​www.tomshardware.com: Intel CPU-dispensing vending machine game spotted in Japan — one user got a Core i7-8700 for $3 | Tom's Hardware
19:58:00 <nikolapdp> that's a great deal
20:02:00 <sham1> Oh god damn it, it's Intel gacha
20:11:00 <zid> gachapon is more fun when it's cool things
20:12:00 <zid> the problem in the west is that they're all full of garbage
20:12:00 <zid> not *once* have I used a gumball machine in europe and gotten used underwear or a piece from a mecha :(
21:53:00 <geist> yah presumaly it's some shop that puts broken or defective cpus in it
22:00:00 <heat> defective cpus?
22:00:00 <heat> wait, why's it full of all the CPUs intel has produced for the last 20 years
22:01:00 <geist> oh i thought the idea was that it had some old cpus in it that didn't necessarily work
22:01:00 <geist> like a core i7-8700 is not exactly a new cpu
22:01:00 <zid> that's the SSR
22:01:00 <zid> commons: Q6600
22:02:00 <geist> Q6600 that brings back memories
22:02:00 <geist> i have one somewhere, just no board to run it on
22:02:00 <heat> the way intel cpu numbering is going i'm not sure if 8700 is old or really new
22:02:00 <zid> old
22:02:00 <geist> old
22:02:00 <heat> old
22:02:00 <zid> they're literally going in order for about 15 years heat
22:02:00 <geist> like i dunno, 2018 maybe
22:02:00 <childlikempress> even older than geist!
22:02:00 <heat> zid, nope, they reset
22:03:00 * childlikempress is still rocking clx
22:03:00 <zid> 2xxx, 3xxx, 4xxx, 5xxx, 6xxx, 7xxx, 8xxx, 9xxx, 10xxx, 11xxx, 12xxx, 13xxx, 14xxx
22:03:00 <heat> the really new CPUs are back to the 1000s
22:03:00 <geist> yah https://ark.intel.com/content/www/us/en/ark/products/126686/intel-core-i7-8700-processor-12m-cache-up-to-4-60-ghz.html
22:03:00 <bslsk05> ​ark.intel.com: Access Denied
22:03:00 <zid> are their last 12 years of desktop chips
22:03:00 <Bitweasil> Yeah, the last... 10-15 years have been i{3,5,7,9}-XXnnn, where XX is the generation (possibly one digit), and then the revision within that.
22:03:00 <geist> not that that still isn't a very useful chip
22:03:00 <Bitweasil> Unfortunately, the revision within that is literally useless, without a lookup table.
22:03:00 <heat> Ermine, what was that weird cpu again you had?
22:03:00 <heat> the really new one
22:03:00 <Bitweasil> But *in general,* the bigger the number within a generation, the more powerful the chip.
22:04:00 <childlikempress> honestly there was no need to make anything past skylake
22:04:00 <geist> they now just dropped the 'i' part, but i think the logic is still the same
22:04:00 <childlikempress> skylake bestlake
22:04:00 <Bitweasil> There's no easy way to see what the difference between an 8600 and 8650 and 8700 are, without lookup tables, though.
22:04:00 <geist> sandy bridge or gtfo
22:04:00 <heat> KABY
22:04:00 <zid> SANDY
22:04:00 <Bitweasil> idk, Ivy Bridge added unrestricted guest virtualization. Which is *properly* nice.
22:04:00 <heat> kabylake is actually a really solid uarch
22:04:00 <childlikempress> snb was good but didn't have nearly enough avxes
22:04:00 <heat> still used
22:04:00 <childlikempress> kbl was just an skl refresh no?
22:05:00 <heat> yeah
22:05:00 <geist> problem with first gen skylake is it has all the meldown/spectre stuff
22:05:00 <childlikempress> yeah
22:05:00 <childlikempress> just keep refreshing skylake forever tbh
22:05:00 <heat> i'm pretty sure facebook is still running kabylake
22:05:00 <geist> you need a few gens after it to get some fixes
22:05:00 <heat> or at least they were running kabylake a few years ago
22:05:00 <childlikempress> '''fix'''
22:05:00 <Ermine> heat: i7-1360P
22:05:00 <heat> exactly
22:05:00 <geist> well, some of the fixes are real
22:05:00 <Ermine> it's raptor lake
22:05:00 <Bitweasil> i7-5600U is my laptop... 2C/4T gutless wonder
22:06:00 <geist> i'm not sold on their new big/little stuff though, though i guess AMD is about to get into that too
22:06:00 <zid> 1360p sounds like a xeon
22:06:00 <zid> I really really want a 1390P
22:06:00 <childlikempress> what's wrong with big.little
22:06:00 <zid> which is a xeon
22:06:00 <Ermine> Tbh I want them to stop doing *lakes and switch to something else
22:06:00 <childlikempress> tbh my hope (probably overly idealistic) is
22:06:00 <zid> cove?
22:06:00 <gog> bay
22:06:00 <zid> LANDING
22:06:00 <geist> not that there's a problem with big/little in general, it's that i dunno if x86 stuff is properly tuned for it
22:07:00 <zid> yea I'm avoiding those cpus if I can
22:07:00 <childlikempress> that big.little will drive software tooling to make it really easy to deal with extremely heterogeneous arches
22:07:00 <zid> they sound like they'd have issues
22:07:00 <geist> even running linu xon the one test machine i have i dont think it really groks it
22:07:00 <zid> someone asked in #gcc today how to make ld not fucking take forever if the final link of their make ends up on the e core, for example
22:07:00 <childlikempress> it definitely hasn't happened yet but if it did that would be a Good Thing
22:07:00 <zid> the scheds need to schedule shit off the e cores if they hit 100% cpu imo
22:07:00 <heat> AIUI the upstream linux scheduler is really not that great with arm big.little either
22:07:00 <Bitweasil> big.LITTLE is fine, IFF you have a scheduler that isn't idiotic with it. And it's not helped by the "Well, the little CPUs don't support everything the big ones do, so we'll just disable those features on the big ones to avoid needing feature-aware scheduling."
22:07:00 <geist> Bitweasil: precisely
22:07:00 <geist> the AMD solution will be much nicer since the cores will be much closer to each other
22:08:00 <geist> at the expense of maybe it doesn't net as many gains, i guess
22:08:00 <childlikempress> cus things are headed towards increasing heterogeneity and special-purpose hardware
22:08:00 <Bitweasil> A feature aware scheduler would be fine, IMO. "Oh, you faulted AVX on an e-core, fine, you're pinned to the p-cores now."
22:08:00 <Bitweasil> Like we do lazy switching for vector and FPU.
22:08:00 <Ermine> heat: that's surprising, android would be interested in good big.little scheduler
22:08:00 <childlikempress> but the software is Not There because no one (except apple and android) are interested in performance on client parts
22:08:00 <Bitweasil> Most of the pieces are already there in the kernel with the lazy switching. It would just have to be added into the scheduler.
22:08:00 <heat> AIUI they used to have tons of patches
22:08:00 <geist> well, i think android is okay with it, they just have a lot of patches
22:08:00 <childlikempress> Ermine: i'm pretty sure android does have good support for it, just not upstreamed
22:08:00 <childlikempress> yeah
22:08:00 <geist> and it's tuned for a specific use case, android
22:08:00 <Bitweasil> Apple's big.LITTLE support in the OS is bloody amazing.
22:08:00 <heat> both android and, before GKI, the vendors
22:09:00 <Bitweasil> I miss my M1 Mini. :(
22:09:00 <geist> that doesn't mean good general purpose support necesarilly
22:09:00 <childlikempress> the fabled 'general purpose' workload
22:09:00 <heat> yep
22:09:00 <childlikempress> :^)
22:09:00 <acidx> Bitweasil: 387 emulation was a thing a while back. would be funny to have that for those cases. :P
22:09:00 <heat> the android kernel has some weird patches that aren't upstreamable
22:09:00 <childlikempress> 'ah yes, i run general-purpose code'
22:09:00 <geist> well, yes you do
22:09:00 <geist> ie, you browse the web, etc
22:09:00 <geist> ie, what regular people do
22:09:00 <acidx> "e-core but it's not efficient in power or time or anything really, it's just funny because all AVX is now SWAR"
22:09:00 <Ermine> eh
22:10:00 <childlikempress> geist: my point is that everything is specialised
22:10:00 <geist> disagree
22:10:00 <heat> disagree
22:10:00 <Bitweasil> acidx, there's no reason to emulate it. Trap the undefined instruction fault, see if it's something the other cores have, and re-schedule on the other cores.
22:10:00 <geist> heh [X] Doubt
22:10:00 <heat> the collection of everything specific gives you a more general-purpose workload
22:10:00 <Ermine> people say that linux, namely pmOS, on thinkpad x13s drains battery a bit faster than windows
22:10:00 <Bitweasil> We *literally* do that for FPU instructions and vector instructions, with the "disable it" bit, so you don't waste time saving FPU registers for a task that won't need them.
22:10:00 <Bitweasil> It faults, you swap the registers out, enable the FPU, resume the task.
22:11:00 <heat> if i take the bits of a program that hammer memory, the bits of a program that hammer the SIMD, and put them all together, it's a general purpose workload
22:11:00 <geist> yah i was thinking about exactly that the other day, i think that's only really feasible on x86
22:11:00 <geist> since the AVX instructions are their own class of instruction
22:11:00 <heat> Bitweasil, we actually don't, no one does lazy FPU for x86 anymore
22:11:00 <childlikempress> xsaveopt?
22:11:00 <Bitweasil> Oh, because it leaked? Bleh. Was wondering about that. In any case, the concept is well established.
22:12:00 <heat> not really, it's just slower
22:12:00 <geist> yeah. and with xsaves, etc its pretty efficient
22:12:00 <Bitweasil> Fair. I mean, just about everything is hammering the vector engine for memset and such these days.
22:13:00 <geist> exactly that too, so the lazy save ends up being not that much of a win
22:13:00 <Bitweasil> The downside is that if it only needs it for a little while, you're pinning it on a p-core for no good reason, but... beats disabling the features entirely, IMO.
22:13:00 <geist> since between any two given context switches it's a pretty good chance the code will use it
22:13:00 <childlikempress> meh the power requirements is mostly from big vectors
22:13:00 <Bitweasil> Or at least give me a firmware config option to enable those features.
22:13:00 <childlikempress> strings fns can use small vectors and still get big wins
22:13:00 <geist> yah right
22:14:00 <geist> and the xsaves/etc actually tracks all of that. tracks if the top of the registers were dirtied, etc
22:14:00 <childlikempress> yeah
22:14:00 <geist> so if you're just running AVX256 code on a 512 machine it ends up being not really any less efficient
22:14:00 <Bitweasil> Ah, okay. I've been in the ARM world for a solid few years now. :)
22:14:00 <geist> yah that's the trick with xsves, it has in hardware bitmaps for what is dirtied and whatnot from last time
22:14:00 <zid> don't tell anybody but avx-512 is fake on amd
22:14:00 <childlikempress> zid: no it's not
22:14:00 <geist> and then it has a compressed storage format, that basically doesn't bother writing out zeros
22:14:00 <zid> childlikempress: that's the spirit
22:14:00 <childlikempress> not in any meaningful sense
22:15:00 <geist> yes i know what you're trying to say: it has 256 bit wide vector ALU
22:15:00 <Bitweasil> The ARMv8/v9 scalable vector stuff is pretty cool. You can write for a 2048 vector, and if it's a 128, 256, 512 hardware... whatever, it'll do what's needed to create the correct result. Just takes longer on some chips.
22:15:00 <childlikempress> you get the same number of gemm flops with avx2 vs avx512 ops, but saying it's fake is an extreme oversimplification
22:15:00 <Bitweasil> (at least as I understand it, I've not had to implement it yet)
22:15:00 <geist> but that doesn't really mean you can't get to the instructions. do the AVX512 general purpose instructions net you amny more stuff from 256? maybe not in that situation, but therea re also a lot of additional non just 'wide ass vector' bits in avx512
22:15:00 <zid> childlikempress: glad i can count on you
22:15:00 <childlikempress> you still save decode/rename slots. and you do have a full-width shuffle unit
22:16:00 <geist> exactly
22:16:00 <childlikempress> and intel has some things half width in avx512, some things even quarter width
22:16:00 <childlikempress> yet no one accuses its avx512 of being fake :p
22:16:00 <zid> I do
22:16:00 <childlikempress> cool😎
22:16:00 <geist> heh you do you zid
22:17:00 <geist> i forget did you get a newer avx512 cpu zid?
22:17:00 <geist> you upgraded iir
22:17:00 <zid> nah it's avx256
22:17:00 <zid> avx512 doesn't even exist, smh
22:17:00 <zid> it's a popaganda piece by intel to sell more.. laptops!?
22:17:00 <geist> right right, becuse it's fake. forgot
22:17:00 <geist> well most of my current machines are AMD, but pre-zen 4, so they dont even have not-real avx512
22:17:00 <zid> I wonder if the fact mainly only laptops had it was coincidence or planned
22:18:00 <childlikempress> not planned
22:18:00 <zid> avx10 also fake, we're up to avx10.1 already
22:18:00 <zid> yea I assume it was just coincidence too
22:18:00 <zid> they got the process working for the laptop skus but not the desktop ones, oopsie, guess laptops get the HPC feature lol
22:19:00 <Bitweasil> Hey, they're good at retracting non-working features on desktop CPUs too. See transactional memory and SGX...
22:20:00 <childlikempress> i would guess it's that limited capacity on the newer processes was prioritised for server/hpc (obvious), but then laptops over desktops because power efficiency
22:20:00 <childlikempress> Bitweasil: transactional memory came back
22:20:00 <childlikempress> because it's actually a really good idea :p
22:20:00 <childlikempress> sgx on the other hand ... lol
22:20:00 <childlikempress> 'SGX is wonderful, it’s led to an entire industry of hackers finding bugs in SGX'
22:21:00 <Bitweasil> Is it back? They gave up for a couple generations of CPU, I thought.
22:21:00 <heat> avx512 being possibly omitted from future CPUs blew up on the intel people making up SysV feature levels' faces
22:21:00 <Bitweasil> After several generates of "Release, whoopsie!"
22:21:00 <Bitweasil> IMO, around the time you're using AVX512, doing GPU compute on the integrated GPU starts looking like a feasible approach...
22:21:00 <childlikempress> wasn't part of the point of avx10 that they were committing to putting it in every future cpu?
22:21:00 <zid> avx10 dead already
22:21:00 <zid> we're 10.1
22:22:00 <childlikempress> Bitweasil: the advantage of avx512 is that latencies are on order of a nanosecond
22:22:00 <childlikempress> so it's easy to integrate with scalar code
22:22:00 <CompanionCube> heat: they can always redefine v4, not like feature levels are actually too important, anyway/
22:22:00 <childlikempress> jsut generally easy interopereability
22:22:00 <childlikempress> if you have a massively parallel problem, sure, go ham on the gpu
22:22:00 <heat> CompanionCube, feature levels are definitely important as they are seeing deployment
22:23:00 <heat> and glibc ldso knows how to use them, and so does everything else
22:23:00 <heat> you can't switcheroo a whole feature level
22:23:00 <Bitweasil> Yeah, that's always the problem with GPU - transfer latency. But integrated GPUs are sharing memory, cache, etc, so you don't have as bad of a hit.
22:23:00 <Bitweasil> If you're doing "one vector thing," sure, keep it on the CPU, but once you get into heavily vectorized code, it'll probably benefit from GPU.
22:23:00 <heat> in fact, IIRC -v4 vs -v3 is mostly a difference of AVX512 :))
22:24:00 <geist> yah
22:24:00 <childlikempress> heat: yeah i remember felix was going off for a bit trying to convince intel to take out 128-bit vector support for avx10
22:24:00 <geist> -v3 is everything up to an including avx2
22:24:00 <childlikempress> so it would be a more reasonable feature level to target--only have to support 256 and 512-bit vecotrs, not 128 too
22:25:00 <heat> why?
22:25:00 <heat> if you have 256 and 512 isn't 128 mostly free?
22:25:00 <Bitweasil> *lobs a molotov-MMX instruction in for lulz*
22:26:00 <Bitweasil> You still need the stuff to track that you're using less of the register, clear bits and pieces, etc.
22:26:00 <childlikempress> heat: no i mean the max vector size
22:26:00 <heat> oh yes that's insane
22:26:00 <heat> who's that for, bochs?
22:26:00 <childlikempress> avx10 is basically avx512 instructions, but the cpu is allowed to just support 256-bit vectors (and fault if you try to use a 512-bit vector)
22:27:00 <childlikempress> so you have to be prepared for 512 or 256 (or just lowest-common-denominator target 256). the goal was to make it so you don't also have to support 128 (or, make it so the lowest common denominator is 256 not 128)
22:27:00 <childlikempress> heat: i mean for software emulators wider vectors is basically free :p
22:27:00 <childlikempress> all the cost is in the dispatch
22:28:00 <heat> isn't qemu tcg avx really recent?
22:28:00 <heat> if its even there at all, can't remember
22:30:00 <childlikempress> 770c2fc7bb7 (Richard Henderson 2017-08-17 14:47:43 -0700 115) #define have_avx1 (cpuinfo & CPUINFO_AVX1)
22:30:00 <heat> that's not true
22:31:00 <childlikempress> so not that new
22:31:00 <heat> "QEMU 7.2 Released With TCG AVX/AVX2"
22:31:00 <heat> so the end of 2022
22:32:00 <childlikempress> idk man https://github.com/qemu/qemu/commit/770c2fc7bb70804ae9869995fd02dadd6d7656ac
22:32:00 <bslsk05> ​github.com: tcg/i386: Add vector operations · qemu/qemu@770c2fc · GitHub
22:32:00 <Ermine> so qemu just emulates them?
22:33:00 <childlikempress> looks like just partial support maybe? so maybe it took that long to implement everything?
22:33:00 <heat> https://www.qemu.org/2022/12/14/qemu-7-2-0/
22:33:00 <bslsk05> ​www.qemu.org: QEMU version 7.2.0 released - QEMU
22:33:00 <heat> IIRC it was a gsoc project and everything
22:33:00 <heat> AVX wasn't implemented for the longest time
22:34:00 <heat> -cpu <cpu model with AVX> never enabled avx in cpuid
22:41:00 <geist> FRED isn't implemented either :(
22:41:00 <geist> qemu 9 was released yesterday or day before
22:41:00 <zid> without fred? disgraceful
22:41:00 <zid> send it back
22:43:00 <dostoyevsky2> geist: any new great features... couldn't find any in the readme, but I guess I have only used like 1% of the features qemu offers
22:43:00 <geist> lots of new riscv stuff. but curiously the whole x86 side is completely blank
22:44:00 <geist> note that they really roll the major numbers fairly fast now, so it's more like a yearly or 9 months cadence they snapshot and make a new major
22:44:00 <geist> so it's not *that* different from 8.x
22:46:00 <heat> x86 considered obsolete
22:47:00 <childlikempress> x86 is OLD and LAMEz0rs
22:49:00 <zid> I'm inventing a new cpu, it's x86, but the TSS gets a huffman table for the instructions that the program uses
22:49:00 <zid> so that the .text density is way higher
22:49:00 <zid> It's also 10x slower to execute, you're welcome
22:50:00 <heat> i'm inventing new entry/exit functionality for the x86
22:50:00 <heat> its better than before, but without an IO bitmap just to piss the microkernel people off
22:52:00 <zid> every syscall instructiont takes a table for which pages need to stay mapped
22:52:00 <zid> on the user stack
22:52:00 <zid> that have to be verified
22:52:00 <childlikempress> i'm inventing a new arch, it's riscv but there's a separate feature flag for every instruction
22:53:00 <heat> genius
22:53:00 <heat> how are you naming the feature flags?
22:53:00 <childlikempress> after #osdev users
22:53:00 <childlikempress> you're not allowed to have more instructions than there are #osdev users
22:53:00 <childlikempress> because MINIMALISM!
22:53:00 <childlikempress> REDUCED
22:53:00 <heat> Zid
22:53:00 <zid> That actually sounds useful, childlikempress
22:54:00 <zid> Can you convert all those feature flags to base64
22:54:00 <zid> and tack it onto the end of the letters 'avx'
22:54:00 <zid> then it'd be double perfect
22:59:00 <Ermine> I'm supposed to be pissed off?
22:59:00 <zid> about what
23:00:00 <zid> did heat call you names again
23:00:00 <heat> the heck did i do
23:00:00 <zid> If he's upsettingly bad at it, I can try, or if he upset you because he's good at it, I can shout at him
23:00:00 <zid> either work for me, I get to shout at someone
23:03:00 <childlikempress> ughhhhh crap. i ran out of disc space in the middle of a brew upgrade and now everything is broken and it's confused
23:03:00 <zid> nice
23:03:00 <zid> That's why you should use a real package manager
23:03:00 <childlikempress> i should! too bad macos doesn't have one :<
23:04:00 <zid> install gentoo on your mac, simple
23:04:00 <childlikempress> fuck you
23:04:00 <dostoyevsky2> geist: they released qemu 8 exactly the same time last year IIRC
23:06:00 <zid> have they cracked the sun code and figure out how long years last
23:10:00 <heat> the sun code??
23:10:00 <heat> don't tell mjg
23:10:00 <heat> is that why a year takes so long?
23:10:00 <dostoyevsky2> slowlaris
23:12:00 <gog> hi
23:14:00 <heat> hi gog happy 25th of april
23:14:00 <gog> it's not that day yet
23:15:00 <heat> yes it is
23:15:00 <heat> just saw the fireworks too
23:22:00 <gog> oh
23:25:00 <zid> do you get fireworks every night
23:25:00 <zid> or just 25th of april
23:26:00 <zid> personally I think the moon should make the westminster chimes when midnight happens
23:26:00 <zid> and the sun should do something cool at noon
23:26:00 <heat> https://en.wikipedia.org/wiki/Carnation_Revolution
23:29:00 <mjg> did anyone highlight me
23:30:00 <heat> no, you can go back to sleep
23:31:00 <zid> abril
23:39:00 <heat> indeed
23:39:00 <mjg> aight cheers
23:41:00 <childlikempress> mjg:
23:43:00 <heat> childlikempress:
23:43:00 <childlikempress> no
23:44:00 <mjg> i'm asleep, please leave a message
23:46:00 <heat> no
23:47:00 <kof673> (from earlier, i am obligate to point out): moonshine: It's meaning derives from the notion of light without heat, or light from the moon (elsewhere "the house of light" lol): > But those that would rightly understand it should first learn the difference between fire and light.
23:51:00 <geist> actually i guess ubuntu 24.04 will be any day now
23:59:00 <mjg> literally today
23:59:00 <mjg> how you doing gents anyway
23:59:00 <mjg> how you doing heat