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=22&m=5&d=19

Thursday, 19 May 2022

00:52:00 <geist> yah i thik the apple M1 is at the end of the day a fancy arm SOC. so once you get running on it it's all the usual bits
00:52:00 <geist> except not documented
01:17:00 <clever> > This applies to more complex dependencies. Consider the following code:
01:17:00 <clever> 
01:17:00 <clever> from the arm link pasted a few hours ago
01:18:00 <clever> geist: my rough guess as to how this works, is that in addition to re-ordering writes, the arm core also keeps a list of pending addr+value pairs, and checks against that for loads? is the data not yet in the L1 cache when that reordering happens? what about a race against another core?
01:20:00 <clever> > If the address is marked as Gathering (G), then the processor can, for example, merge two bytes writes into a single halfword write
01:21:00 <clever> the rpi's MMIO is almost entirely 32bit only, nothing bigger and rarely smaller, so thats definitely a case for non-gathering
01:21:00 <clever> and the few 16bit regs that do exist, have timing related bugs where transfers can be lost, so sticking to 32bit is best
01:22:00 <heat> does anyone know how uninitialised the qemu x86 machines are at boot?
01:22:00 <heat> like at the reset vector
01:23:00 <clever> heat: in terms of "motherboard" peripherals, cpu, or ram contents?
01:23:00 <heat> yes.
01:23:00 <clever> ram i think would be the simplest one to answer...
01:24:00 <clever> oh, and tcg vs kvm also comes into play
01:24:00 <heat> i found it though, qemu -S works
01:24:00 <heat> pci is uninitialized, the CPU as well (although I did see a weird value in EDX)
01:24:00 <heat> is this part of the initial x86 state? possibly
01:24:00 <heat> ram is inited yeah
01:25:00 <heat> then you're supposed to get more metadata from fw_cfg
01:25:00 <clever> all zero'd?
01:25:00 <heat> i think so
01:25:00 <heat> the fw isn't zeroing it
01:25:00 <heat> and I've never found garbage in RAM
01:26:00 <clever> hw/arm/virt.c: memory_region_add_subregion(mem, base,
01:26:00 <clever> ah, thats what i was looking for
01:27:00 <clever> 1704 memory_region_allocate_system_memory(ram, NULL, "mach-virt.ram",
01:27:00 <clever> this is what creates the ram itself
01:28:00 <clever> hw/i386/pc.c: memory_region_allocate_system_memory(ram, NULL, "pc.ram",
01:28:00 * heat nods
01:28:00 <clever> and now that i know the name, i can find it in x86 as well
01:28:00 <clever> and i think `info qtree` or something, will show you pc.ram
01:28:00 <clever> or `info mtree`?
01:28:00 <heat> i was trying to eyeball what would be needed for the simplest qemu firmware
01:28:00 <clever> include/hw/boards.h: * memory_region_allocate_system_memory - Allocate a board's main memory
01:29:00 <heat> pci bar allocation, chipset driver, fw_cfg driver
01:29:00 <clever> that file has a 20 line comment explaining it
01:29:00 <clever> my only complaint with fw_cfg, is that it has no support for dynamically adding it to a guest
01:29:00 <clever> so the machine definition must create a fw_cfg peripheral
01:29:00 <clever> (and the rpi doesnt)
01:29:00 <heat> the chipset driver probably has a way to set the PCIe bar or something
01:29:00 <heat> s/bar/allocation/
01:35:00 <clever> 25 * Memory allocated via this function will be backed with the memory
01:35:00 <clever> 26 * backend the user provided using "-mem-path" or "-numa node,memdev=..."
01:37:00 <clever> 518 memory_region_init_ram_nomigrate(mr, owner, name, ram_size, &error_fatal);
01:38:00 <clever> 1524 mr->ram_block = qemu_ram_alloc(size, share, mr, &err);
01:41:00 <clever> 2260 new_block->host = phys_mem_alloc(new_block->max_length,
01:41:00 <clever> 1446 static void *(*phys_mem_alloc)(size_t size, uint64_t *align, bool shared) =
01:42:00 <clever> heat: aha, there is a global func ptr, that all memory gets allocated via
01:42:00 <clever> only ever modified by one foreign target
01:42:00 <clever> qemu_anon_ram_alloc is the default implementation
01:43:00 <clever> util/oslib-posix.c:void *qemu_anon_ram_alloc(size_t size, uint64_t *alignment, bool shared)
01:43:00 <clever> and each os defines its own variant
01:45:00 <clever> i think its mmap'ing fd -1??
01:48:00 <heat> its anon memory no?
01:49:00 <clever> yeah
01:49:00 <clever> just a bit surprised that i dont see the man page explaining that
01:50:00 <heat> the fd field is only valid for file mappings
01:50:00 <heat> what else would you put there?
01:50:00 <clever> ah right, other flags could tell it to ignore the fd
01:50:00 <heat> MAP_ANONYMOUS does
01:50:00 <clever> 141 flags |= fd == -1 ? MAP_ANONYMOUS : 0;
01:51:00 <clever> bingo
01:51:00 <clever> the flag gets added if other code tried to mmap -1
05:36:00 <No_File> Back 2 ROOTS https://imgur.com/H36LTRV
05:36:00 <bslsk05> ​'C64 Browser' by [idk] (--:--:--)
06:10:00 <geist> wow. libera is a year old?
06:10:00 <geist> did the. uh. event happen a year ago?
06:10:00 <kazinsal> I guess, dang
06:11:00 <kazinsal> yeah, seeing articles from the 19th last year about communities moving to libera
06:11:00 <clever> i discovered by accident, that leenode is allowing unregistered users in once more
06:11:00 <clever> after rebooting my system, my irc client auto-connected to it twice
06:12:00 <clever> i heard at one point, that you couldnt even connect without first registering on the website
06:12:00 <kazinsal> admittedly I was pretty skeptical about an IRC network that had "libre" as a root for its name if only because it brought to mind "libertarian" but I'm glad that libera is a quite pleasant and progressive place
06:13:00 <kazinsal> (though it may skew a bit in my eyes because I'm only in this channel, which has been a very accepting place for longer than it's been on this network)
06:35:00 <geist> yah i wonder how the sister #osdev survived over there
06:36:00 <geist> at some point i couldn't log in because irccloud was banned, and that was the end of even attempting to try to follow along
06:36:00 <geist> honeslty i hadn't really even thought about it in probably 6 months until today
06:36:00 <kazinsal> totes, freenode is pretty much ancient history in my mind at this point
06:36:00 <kazinsal> the Before Times so to speak
06:37:00 <Mutabah> The way I saw it, Libera _is_ freenode (the core of it at least, and many of the communities outright moved)
06:37:00 <vdamewood> It's like someone painted over the sign, and wrote Libera in its place.
06:37:00 <kazinsal> pretty much yeah
06:38:00 <geist> yah pretty amazing how well that transitioned over (at least in #osdev case)
06:38:00 <klange> New name, same people - staff _and_ communities
06:38:00 <geist> a few channels i follow went over to oftc, but as far as i can tell thats working fine too
06:38:00 <Mutabah> Biggest difference about libera: I OWN THIS CHANNEL, MUAHAHAHAHA
06:38:00 <clever> some fragmented to both matrix and libera
06:39:00 <klange> That's really why it worked so well, it was pretty immediately clear what was happening, so most people just needed to change a line in their IRC client configs and away we went.
06:39:00 <vdamewood> There was a shakeup of owners in ##programming too.
06:39:00 <geist> omg dont go crazy on us Mutabah
06:39:00 <kazinsal> hah, yeah, at least with libera we know who the god emperor of the channel/org is
06:39:00 <vdamewood> geist: go? present tense?
06:39:00 <geist> i'm watching an open source project i've been following disassemble itself in real time right now (SIMH)
06:39:00 <Mutabah> ... I had forgotten until just then
06:39:00 <geist> and it's really not pretty
06:39:00 <kazinsal> geist: oh jeez, what happen
06:39:00 <Mutabah> vdamewood: Hey! I resemble that insult
06:39:00 <geist> it'sin the middle of exploding, which is a real shame
06:40:00 <vdamewood> Mutabah: Ad mit it, if you weren't nuts, you wouldn't be here.
06:40:00 <vdamewood> admit*
06:40:00 <Mutabah> geist: Oof, I just saw it on /r/programming
06:40:00 <geist> the guy that does most of the simh v4 work is throwing a super tantrum, and he controls the github repo, etc
06:40:00 <kazinsal> oh fun
06:40:00 <No_File> 010001110111010101110100011001010110111000100000010011010110111101110010011001110110010101101110
06:40:00 <geist> yeah it's still going on, but it's one of these cases where the project has never had any real governance or whatnot for like 10 years since it has just worked fine
06:41:00 <geist> but then the defacto project owner is throwing some tantrum now and basically trying to modify the license for petty reasons
06:41:00 <klange> We also took the 'opportunity' of this technically being a new channel to establish in its registration an official connection to osdev.org.
06:41:00 <geist> and lots of folks are having none of it
06:42:00 <geist> doesn't help that the original simh project was created by a guy that has no interest in open source, more or less
06:42:00 <geist> he has his ftp server that serves up updates, and has no problem with folks using it (it has a BSD license on it) but has no interest in running the project
06:42:00 <geist> so he was always silently just working on the original fork of the project (simh v3), while the defacto github project (v4) has been progressing for a long time
06:43:00 <kazinsal> hmm, yeah, that complicates things
06:43:00 <geist> so there was always 2 forks of it effectively
06:43:00 <vdamewood> I propose we call the split of Libera from Freenode, "the Forkening".
06:45:00 <klange> It's like a classic Unix fork(), though. Freenode got paged to disk, Libera stayed resident... and then the disk got filled with garbage :)
06:59:00 <geist> ugh, cable modem keeps resetting yay
07:06:00 <No_File> https://imgur.com/fmbDuKS
07:06:00 <bslsk05> ​imgur.com: Imgur: The magic of the Internet
07:09:00 <geist> grats?
07:10:00 <kazinsal> reminds me, I need to buy a new lightning to 3.5mm adapter
07:10:00 <kazinsal> I swear the apple ones only last six weeks
07:19:00 <No_File> biggest trap in human history, the apple.
07:24:00 <mrvn> geist: changing a license is nearly impossible. It only takes one person disagreeing.
07:25:00 <geist> it's more subtle than that. what he wants to do is 'lock down' some of the recent changes he made to the project
07:25:00 <kazinsal> yeah, it looks more like an addition to the license that conveniently makes it non OSI compliant
07:25:00 <geist> but adding some additional clauses about 'you can do what you want but you can't undo these changes or modify any files i've touched after this point in time' nonsense
07:25:00 <kazinsal> it's almost a relicensing but questionably legally distinct
07:25:00 <geist> and folks are pointing out that's at best just a really dickish thing to do
07:26:00 <geist> ie, your license to his changes are revoked if you remove them or disable them, etc. really dumb shit
07:26:00 <mrvn> which would make it impossible to fix any bugs in the mentioned code.
07:26:00 <geist> basically he's forked it. which is i guess his perogative, except it's the main github repo and he wont let anyone else do it
07:27:00 <geist> mrvn: right
07:27:00 <geist> folks are pointing out all sorts of issues, such as that
07:27:00 <geist> he's basically doing the equivalent of taking his toys and going home because of some disagreement about some feature he added
07:27:00 <geist> which is fine except he controls the repo and the github org and wont let anyone else do anythig about it
07:27:00 <mrvn> That's the point where I would just say: You go do that. We will just keep the existing version.
07:28:00 <geist> that's effectively where it's at. the community is probably going to fork it just before his changes
07:28:00 <mrvn> forking is easy
07:28:00 <geist> and he's basically 'go ahead, notice i have control of the main project that people will find'
07:28:00 <geist> sigh.
07:28:00 <mrvn> search engines qill change the ratings quickly based on activity on the repos.
07:28:00 <mrvn> s/qill/will/
07:29:00 <geist> well he *is* the main developer
07:29:00 <geist> by a long shot
07:29:00 <geist> would be kinda like if a bunch of us were hacking on sortix and sortie decided he wanted to throw a wrench in for some favorite feature
07:29:00 <geist> sortie would say 'you can add features but you can't touch any of this code or remove any of it or you dont get a license to use it anymore'
07:30:00 <geist> which may be legally okay, but just a really dicky thing to do
07:30:00 <geist> (or maybe not legally okay)
07:31:00 <mrvn> if there is even one commit from another person then that person can veto the license change. So not legally ok.
07:31:00 <geist> it's the 'yopu dont get a license to use it' part that's the dicky thing. someone that controls the repo is free to not accept patches or whatnot, but to add a clause to the licnse that says you can modify eveyrthing *except* these files after this point in time, is pretty lame
07:32:00 <geist> right, he's saying 'all changes my by past this commit where i have modified the license'
07:32:00 <geist> or something like that. anyway. whatever. it's just really silly and petty
07:32:00 <mrvn> which may or may not be legal. GPL doesn't allow that.
07:32:00 <geist> the main shame is it *is* the main developer
07:32:00 <mrvn> which is one of the reasons I like the gPL.
07:32:00 <geist> so by him taking his toys and going somewhere else it loses most of the development. he's effectively made a closed source fork
07:33:00 <bauen1> mrvn: yeah, i was about to ask if he can even do that or if that would violate the license _he_ has from other contributors due to imposing additional restrictions
07:34:00 <geist> for future changes after a point, but then he has the main repo (github.com/simh/simh)
07:34:00 <bslsk05> ​simh/simh - The Computer History Simulation Project (269 forks/1393 stargazers/NOASSERTION)
07:35:00 <mrvn> geist: simh is already non-free. It has the advertising clause.
07:36:00 <geist> a semantic difference
07:36:00 <geist> folks use it in projects
07:36:00 <mrvn> But they aren't allowed to say so
07:36:00 <geist> say so what?
07:36:00 <mrvn> although, wait, it doesn't say simh must not be used, only the authors name.
07:37:00 <geist> yah it's the standard 'you can't use my name for advertising with stuff made with this' which seems fine to me
07:37:00 <mrvn> So I can say: My project uses simh. But not: My project uses simh by Robert M Supnik, Mark Pizzolato and others.
07:37:00 <geist> right. standard N clause BSD
07:37:00 <mrvn> well, if they don't want credit for their work. :)
07:38:00 <geist> sure. it's the nonsense he added tothe license file at the end of it that is setting everyone off
07:39:00 <geist> basically it's this one feature he added that was controversial, for silly reasons, and instead of backing down he baked it into the license that you can't touch it in any fork you may have of the code
07:39:00 <geist> which is <eyes roll>
07:48:00 <mrvn> My reaction would be to fork that file and change all the emulators I'm involved in to use the fork thereby sidestepping the license change.
07:48:00 <mrvn> See "Group 2"
07:56:00 <mrvn> Line 66-68 in the license.txt is illegal. Can't change the license retroactively.
07:56:00 <mrvn> that makes the whole license invalid in many jurisdictions.
08:03:00 <gamozo> Wooo! Power is back!
08:05:00 <mrvn> https://www.shutterstock.com/image-illustration/cute-cartoon-kitten-taking-power-nap-1790302490
08:05:00 <bslsk05> ​www.shutterstock.com: Cute Cartoon Kitten Taking Power Nap Stock Illustration 1790302490 | Shutterstock
08:05:00 <zid> where did you lose it?
08:06:00 <gamozo> Somewhere right after the G4/G5. Naw, in seattle, lots of wind storms yesterday
08:06:00 <gamozo> I live in the middle of nowhere so if trees move a bit I lose power
08:06:00 <zid> we have an invention called holes
08:06:00 <mrvn> I'm so happy that germany has overland power cables above the tree tops and local power cable under the earth.
08:07:00 <gamozo> Apparently we tried to vote for that but everyone was against the higher prices
08:08:00 <mrvn> and now they pay for it with every storm
08:08:00 <zid> but.. holes are cheaper
08:08:00 <Griwes> coworker who lives basically in the city center of Seattle also had power troubles today (or yesterday depending on how you like to use those words)
08:08:00 <Griwes> not every storm, just the major ones :'d
08:08:00 <zid> employing a huge fleet of grounds managers is kinda pricey
08:09:00 <Griwes> zid, no, you have to dig, potentially under things, as opposed to just planting a pole (definitely not a Pole though, please) and running some cables
08:09:00 <zid> TCO
08:09:00 <gamozo> Way cheaper to get a generator than to redo infra
08:09:00 <mrvn> Nowadays they can shoot the cable through the earth without digging a trench.
08:09:00 <gamozo> And people don't really care about losing power. It's not like everyone is spending 16 hours a day on the computer like me :D
08:10:00 <gamozo> mrvn: They're doing that for my fiber right now! It's such a cool thing to watch
08:10:00 <zid> I can't imagine how many teams of guys your power companies must employ to trim hedges
08:10:00 <zid> I've even seen them use helicopters to do it
08:10:00 <mrvn> flying a helicopter near power lines? not smart.
08:10:00 <gamozo> That's pretty much only for main lines, and that's pretty much pointless to bury
08:11:00 <gamozo> Those helicopter pilots are wild lol
08:11:00 <Griwes> even if you can shoot a cable through the earth, you still have to dig holes through, well, things
08:12:00 <Griwes> replacing a sidewalk or pavement has got to be more expensive than planting a few poles
08:12:00 <gamozo> https://www.youtube.com/watch?v=z-wQnWUhX5Y Relevant
08:12:00 <bslsk05> ​'Repairing Underground Power Cables Is Nearly Impossible' by Practical Engineering (00:13:34)
08:12:00 <zid> why would you do that
08:12:00 <Griwes> why would you do what
08:12:00 <zid> replace a sidewalk
08:13:00 <Griwes> if you need to punch down a hole for a junction or whatever
08:13:00 <mrvn> Griwes: for underground you pay once (in a long long time), a pole you pay frequently.
08:13:00 <mrvn> problem is: the pole already exists
08:13:00 <zid> making a hole in asphalt is a thing there exist billions of companies for and they do it cheap
08:13:00 <Griwes> yeah the problem is that for underground you need to pay it up up front
08:13:00 <zid> roadworks aren't new
08:13:00 <gamozo> It's really not that simple lol. Underground power is not easy/cheap
08:14:00 <zid> It is cheap, but it requires the companies involved not to be chasing quarterly reports
08:14:00 <zid> in order to look cheap
08:14:00 <mrvn> gamozo: I believe it's cheaper. It's just a big cost up front.
08:14:00 <Griwes> yeah. and sometimes "cheaper up front" just wins
08:15:00 <gamozo> Cheaper up front is kinda mandatory at least in the US, where it's just so massive and people are so spread out
08:15:00 <zid> Our government will probably find a way to sell the copper eventually
08:15:00 <mrvn> that's because the person doing it up front gets payed for building it and doesn't have to maintain it
08:16:00 <mrvn> What contract includes a 10-100 year maintainance cost?
08:20:00 <gamozo> I mean, I'll chagre you for maintainance for 10-100 years, but you won't get much for it ;)
08:24:00 <geist> gamozo: yah no power loss here on the island, but the network is going up and down
08:33:00 <mrvn> 2h without power, no problem. That's why laptops have batteries. 2h without network. OMG the world is ending.
08:34:00 <geist> right? i have a 20kW generator for power
08:34:00 <geist> but no network? what's the point!
08:35:00 <mrvn> I need an adaptor to power my FritzBox from USB.
08:44:00 <geist> huh its' actually a thing
08:45:00 <mrvn> you found a commercial one?
08:46:00 <gamozo> Ahahaha. Power outages is why I'm getting fiber put in right now. I can do a generator, but without dedicated fiber I lose my internet anyways. I'm super excited to no longer care about power outages soon!
08:46:00 <gamozo> (me, justifying fiber to myself)
08:47:00 <mrvn> you think the hardware at the other end of the fibre has a generator too?
08:47:00 <gamozo> With the dedicated ethernet I'm getting that has an SLA, yes
08:47:00 <gamozo> With normal fiber, absolutely not
08:48:00 <mrvn> oh, pricey
08:48:00 <gamozo> Yes :( Very pricey. But I'm getting 4gbit full-duplex dedicated and I'm absolutely thrilled
08:48:00 <mrvn> thought you ment fibre vs copper
08:48:00 <gamozo> Ah, nah. I decided to get some dedicated ethernet, largely because I want to see what it's like. Who knows if I'll continue using it after the contract is up. Required a 5 year contract :\
08:50:00 <gamozo> They've been drilling this whole month, it's actually kinda wild that it's happening. I've always drempt of this as a kid aha. Apparently they said I'm the second residental place they've done. Apparently some family did it for a massive household of gamers lol
09:42:00 <mrvn> Can I write std::array<int> a{1, 2, 3}; in some way?
09:42:00 <Mutabah> What's the context?
09:43:00 <mrvn> any C-style array with initilizer where I don't want to count how many items the array has.
09:43:00 <mrvn> (and want to get rid of the C-style array because they are bad)
09:44:00 <Mutabah> Is this in C++, or C? Are you thinking those braces are an array on their own?
09:44:00 <mrvn> obviously C++.
09:45:00 <Mutabah> That's not a C array, it's an initializer for the `std::array`
09:45:00 <mrvn> Modern c++ has int a = 1 === int a(1) === int a{1} pretty much everywhere
09:46:00 <mrvn> Mutabah: the bad code is int *p = new int a[] {1, 2, 3};
09:47:00 <Mutabah> An
09:47:00 <Mutabah> *Ah
09:47:00 <mrvn> I can write std::array<int, 3> a{1, 2, 3}; but why should I have to count the items?
09:48:00 <Mutabah> Oh... right...
09:48:00 <Mutabah> Use vector? (the original code did allocate, for some reason)
09:49:00 <xenos1984> http://en.cppreference.com/w/cpp/container/array/deduction_guides
09:49:00 <bslsk05> ​en.cppreference.com: deduction guides for std::array - cppreference.com
09:50:00 <klange> C++17 can apparently do `std::array a{1, 2, 3};`
09:52:00 <mrvn> ahh, right, stupid me. Why even give a type. But what if I want std::array<double> a{1, 2, 3}?
09:52:00 <klange> then start typing dots :P
09:53:00 <mrvn> that's fine for double. A lot of typing when it's some long winded constructor. :( I guess then I have to count.
09:55:00 <mrvn> or this: std::array c(std::to_array<short>({3, 2, 1})); // C++20 alternative, creates std::array<short, 3>
11:40:00 <FatAlbert> GeDaMo: how you doing ?
11:42:00 <GeDaMo> OK
11:42:00 <FatAlbert> glad to hear
11:42:00 * vdamewood gives GeDaMo a porcupine.
11:43:00 <GeDaMo> I shall call him Spikey and hug and squeeze ... ow!
11:43:00 <vdamewood> GeDaMo: Go *with* the grain on one of those.
12:27:00 <blockhead> GaDaMo: points for the Bugs Bunny reference :)
12:40:00 <GeDaMo> I thought it was an Of Mice and Men reference but OK :P
12:42:00 <blockhead> maybe BB referenced of mice and men
12:42:00 <GeDaMo> Probably, yes :P
12:43:00 <jimbzy> Yeah
12:45:00 <blockhead> the line in the bugs bunny episode is "I will name him George and I will hug him and squeeze him". wikipedia says one of the characters of Of Mice And Men is named George. Yup, gotta be a reference. That's a new on one me. :)
12:51:00 <kingoffrance> there was an old snl of mice and men :) ill throw in chrono trigger and woodland critter christmas re: porcupines
13:04:00 <GeDaMo> There's a scene in Of Mice and Men where George hugs a rabbit to death :/
13:05:00 <kingoffrance> yeah, the snl does that lol
14:02:00 <GeDaMo> https://lobste.rs/s/iqafw3/alternatives_rasberry_pi
14:03:00 <bslsk05> ​lobste.rs: Alternatives to rasberry pi | Lobsters
17:00:00 <mrvn> https://godbolt.org/z/Tcc66fo1n Is gcc wrong on the arry bounds? data should be 2x2 ints and the asm shows it's 16 byte but gcc says the array has size 8
17:00:00 <bslsk05> ​godbolt.org: Compiler Explorer
17:08:00 <vdamewood> mrvn: It's only member is a pointer, not an array.
17:08:00 <vdamewood> err its
17:08:00 <vdamewood> sizeof(some pointer) is 8 on 64-bit systems.
17:11:00 <mrvn> ahh, it should be (*this)[i][j]
17:11:00 <mrvn> stupid precedences
17:12:00 <kingoffrance> yes, sizeof(a) 4 :)
17:14:00 <mrvn> Not sure how that compiled before: this[i] is a Matrix<T>, this[i][j] then is a T* (from operator[]). But other[i][j] is int.
17:15:00 <mrvn> Am I getting that wrong? Where is the error for converting int to int*?
17:16:00 <mrvn> ah *patsch* forgot the * in the front. *(int*) = int is fine.
18:47:00 <mrvn> What's the syntax again to apply a parameter pack to a function?
18:47:00 <mrvn> (call f(x) for each x in the pack)
18:47:00 <Griwes> C++17 or before?
18:48:00 <mrvn> c++20
18:48:00 <Griwes> (f(args), ...);
18:50:00 <CompanionCube> clever: iirc you also have a FX8350, so pasting this here in case you have any thoughts: 'tfw considering upgrading from the FX8350 not because of performance but because of a semi-broken CPU fan and as the FX8350 does not have a reputation for being power-efficient it's low hanging fruit vis a vis energy bills'
18:51:00 <mrvn> Matrix(Vec<U, N> v...) { ([&](auto &t){ ... }(v), ...); } operand of fold expression has no unexpanded parameter packs
18:53:00 <clever> CompanionCube: i have also had a string of what seem to be thermal shutdowns lately
18:54:00 <CompanionCube> clever: my issue is that replacements don't seem to be fitting, alas
18:54:00 <clever> CompanionCube: and the last time that happened, i checked the power usage graphs, and it was pulling over 10 amps, and went right off the graph scale
18:55:00 <clever> 10 amps on the cpu itself, not the wall
18:57:00 <mrvn> nm, got it
19:10:00 <mrvn> 1) How do I write a constructor so the std::initializer list has a fixed size? 2) How do I write a deduction guide for Matrix(T, U...) when T can construct Vec<X> -> Matrix<X, 1+sizeof(U), T::size()>?
19:18:00 <Griwes> For 1 you'd probably take a tuple and constrain its parameters to be same_as<type you want>
19:18:00 <Griwes> I'm not sure I understand "when T can construct blah" in 2
19:20:00 * geist yawns
19:20:00 <mrvn> Matrix m{{1,2},{3,4}} should do {Vec{1,2}, Vec{3,4}}
19:21:00 <mrvn> Or how do I deduce both rows and cols from the nested initializer list?
19:22:00 <Griwes> I don't think you can deduce like that, braced initializer do not have a type as expressions
19:23:00 <Griwes> Let me check tho
19:25:00 <geist> if you deduced it, you produced it
19:27:00 <heat> haha C goes brrrrrrrrrr
19:27:00 <mykernel> i need help booting my kernel on hardware: my really old celeron pc boots kernel just fine but this newer laptop tries booting kernel in uefi mode bcs grub-mkrescue generates gpt part table and it fails because my kernel uses text mode
19:27:00 <mykernel> how do i force grub-mkrescue to generate mbr part table
19:27:00 <heat> use CSM if you have it
19:27:00 <heat> it's not the mbr nor the gpt
19:28:00 <Griwes> mrvn, yeah no, I don't think you can deduce that, because of the braced init expressions
19:28:00 <heat> the CSM will probably emulate text mode (probably, not sure)
19:28:00 <mykernel> laptop is x86 (32 bit)
19:28:00 <mrvn> https://godbolt.org/z/G59Maozxv Works for aggregate types :(
19:28:00 <bslsk05> ​godbolt.org: Compiler Explorer
19:29:00 <Griwes> huh
19:29:00 <Griwes> it's probably the array doing magic
19:29:00 <Griwes> yeah it is
19:30:00 <heat> I use standard int types and size_t without std:: in C++
19:30:00 <heat> am I going to hell?
19:30:00 <Griwes> yes
19:30:00 <Griwes> your code won't compile under reaveros' stdlib
19:31:00 <jjuran> Just include <stdint.h> and <stddef.h>
19:32:00 <Griwes> or, to put it differently, unless you're including the C headers directly, your code depends on a non-portable property of the c++ headers in your implementation
19:32:00 <mrvn> that would be cstdint and cstddef
19:32:00 <jjuran> No, those define types under std::
19:33:00 <heat> cstdint and cstddef also define them out of std:: iirc
19:33:00 <jjuran> They're allowed to but not required to
19:33:00 <Griwes> ^
19:34:00 <heat> https://github.com/griwes/reaveros/blob/main/userspace/services/logger/main.cpp#L37 Griwes I am going to report you to the C++ standards commitee for undefined behavior
19:34:00 <bslsk05> ​github.com: reaveros/main.cpp at main · griwes/reaveros · GitHub
19:34:00 <heat> inb4 it's not UB
19:35:00 <Griwes> it sure is, it just so happens that this implementation defines its meaning :P
19:35:00 <jjuran> Some folks who inhabit C++ IRC channels live in a fantasy realm where C headers are deprecated
19:35:00 <heat> REPORTED TO THE COMMITEE
19:35:00 <Griwes> I AM THE COMMITTEE
19:36:00 <jjuran> heat: Spelling police! Pull over!
19:36:00 <heat> jjuran: Spelling-police police! Get your hands out of the vehicle!
19:37:00 <jjuran> You better stand down before someone calls the meta police
19:37:00 <heat> facebook.com police?
19:37:00 <jjuran> …
19:37:00 <jjuran> No.
19:37:00 <heat> using … is incredibly based
19:37:00 <mrvn> Griwes: I can pipe the data through an array class but then I have to write: Matrix a{AutomaticMatrix{{{1, 2}, {3, 4}}}}; https://godbolt.org/z/bas89Kfrh
19:37:00 <bslsk05> ​godbolt.org: Compiler Explorer
19:38:00 * jjuran still doesn't know what "based" means
19:38:00 <Griwes> its meaning is based
19:39:00 <heat> "1) true/factual. Used in political slang and used ironically in memes. "
19:39:00 <heat> "2) someone/something that is cool and/or speaks the truth"
19:40:00 <heat> according to the great source "Urban dictionary"
19:44:00 <Griwes> mrvn, yeah I think you'd need to have expression rewriting rules to make that work without the extra thing
19:44:00 <mykernel> exit
19:45:00 <Griwes> you could also have syntax like `make_matrix{...}.convert()` or something that *feels* better to my eyes, but ymmv
19:46:00 <heat> aw yeah syscalls work in IRC too?
19:46:00 <heat> fork()
19:46:00 <heat> I don't think it worked
19:46:00 <heat> I don't think it workedI don't think it worked
19:46:00 <heat> aw fuck
19:46:00 <heat> I tried
19:47:00 <mykernel> dumb question
19:47:00 <mrvn> Griwes: I tried AutomaticMatrix::operator Matrix<T, rows, cols>() but that doesn't get invoked on initialization
19:48:00 <mykernel> if cpu is x64 capable and bios/motherboard isnt
19:48:00 <heat> that's impossible
19:48:00 <mykernel> heat: what
19:48:00 <heat> the BIOS/motherboard have nothing to do with 64-bit vs 32-bit
19:49:00 <heat> if the chipset supports 32 and 64-bit CPUs, that's not a problem
19:49:00 <mrvn> Griwes: Isn't there some way to say: If someone tries "Matrix(x)" try "Matrix(AutomaticMatrix(x))" first? there has to be some way to trigger the implicit conversion
19:50:00 <Griwes> mrvn, at the current time there is not, but I think this use case requires more than just that, it requires it to be a *syntactic* rewrite, because the argument does not actually have a type at that point
19:52:00 <mrvn> template<typename... U> Matrix(U... u) : Matrix(AutomaticMatrix(u...)) { }
19:52:00 <mrvn> Shouldn't that deduce the parameter?
19:52:00 <Griwes> no
19:53:00 <Griwes> delegating ctors are just functions whose implementation delegates
19:53:00 <mrvn> The forwarded constructor deduces them.
19:53:00 <Griwes> they aren't transparent
19:53:00 <mrvn> delegated I mean
19:54:00 <heat> rust
20:17:00 <mrvn> Best I manage to achive is: Matrix a{M{{{1, 2}, {3, 4}}}}; If you want to play: https://godbolt.org/z/46vEqbvax
20:17:00 <bslsk05> ​godbolt.org: Compiler Explorer
20:27:00 <moon-child> lock()
20:27:00 <moon-child> lock()
20:27:00 <moon-child> I don'
20:30:00 <mrvn> moon-child has deadlocked
20:47:00 <heat> should've used RCU
21:10:00 <zid> I'm not sure a read-copy-update is going to help heat, as lmuch as you love them
21:17:00 <mrvn> Griwes: stackoverflow suggested: Matrix(const T (&other)[rows][cols]); So same as my idea but no wrapper class around the C-style array.
21:22:00 <Griwes> Hmm, yeah, that's clever (in the positive way), assuming it works :p
21:24:00 <mrvn> clever: you are a C-style array, amazing. :)
21:24:00 <clever> mrvn: i am?
21:24:00 <mrvn> "that's clever"
21:24:00 <clever> ah, lol
21:25:00 <clever> https://gitlab.freedesktop.org/drm/amd/-/issues/2018
21:25:00 <bslsk05> ​gitlab.freedesktop.org: amdgpu_cs_ioctl kernel null pointer when receiving v3d ioctl (#2018) · Issues · drm / amd · GitLab
21:25:00 <clever> mrvn: i'm also the one breaking the linux kernel
21:25:00 <clever> i managed to find a null pointer deref in my video driver
21:25:00 <clever> 2022-05-19 17:00:22 < airlied> it's like fuzztesting by accident
21:57:00 <bauen1> i've (annoyingly) managed to find a null pointer deref in the linux audit part by accident, and it requires a very specific setup too:
21:58:00 <bauen1> 1. have a kernel iirc >5.4 <5.7 ; enable selinux and load a policy, and audit a certain directory access event generated by systemd --user
21:58:00 <mrvn> so now debug it, fix it and send a pull request
21:58:00 <bauen1> the way i found it was by disabling SELinux trying to find out if it was blocking polkit from working (it wasn't the issue), just the be met by the kernel slowly going insane
21:59:00 <bauen1> mrvn: i reported it after i found it and it's already been fixed
22:00:00 <bauen1> mrvn: but thinking back, i think i also hit a null-ptr-deref in the hfs4 driver in linux ? something which caused the filesystem to become so full that you couldn't delete files or even extend its size anymore ; arguably that was a good thing because that day i nuked the macos instalation on in favour of linux
22:01:00 <bauen1> and i really wonder if that has been fixed, but at the time i couldn't find that out
22:02:00 <clever> in my case, the ioctl's for the v3d and amdgpu driver overlap
22:02:00 <clever> so userland things its issueing a DRM_IOCTL_V3D_GET_PARAM to query the ident registers on the hw
22:02:00 <clever> but the kernel thinks its a DRM_IOCTL_AMDGPU_CS query
22:02:00 <mrvn> Do the NASA thing: Just don't do the thing that bugged.
22:02:00 <bauen1> clever: shouldn't improper ioctl generally not cause kernel bugs ?
22:02:00 <clever> and then everything goes horribly wrong, as the command is parsing garbage
22:03:00 <clever> bauen1: the ioctl is reused between many drivers
22:03:00 <clever> 2022-05-19 18:47:02 < anholt> the kernel interface should already be fuzzed. and, if userspace wants to ignore the kernel telling it what driver it is talking to, you can't really stop them.
22:03:00 <clever> 2022-05-19 18:48:28 < clever> did the fuzzing miss it?
22:03:00 <clever> 2022-05-19 18:48:36 < anholt> the kernel probably wasn't fuzzed, which is a problem.
22:03:00 <clever> and due to somebody not keeping up with fuzzing the ioctl api, the bug has slipped into linux, and has been in release kernels for ~2 years
22:04:00 <clever> seperately, i also found a DoS attack in chrome's rendering routines
22:04:00 <clever> https://www.home-assistant.io/docs/mqtt/discovery/#climate-control
22:04:00 <bslsk05> ​www.home-assistant.io: MQTT Discovery - Home Assistant
22:04:00 <clever> if you point the mouse at the "need help?" bit just right, the on-hover thing will flicker
22:05:00 <clever> the more tabs you have open, the more cpu usage that flickering causes
22:05:00 <clever> at 2000 tabs, it causes enough cpu usage to jam up the master chrome process for 30+ minutes, from just 0.2 seconds of hover
22:06:00 <mrvn> I had that in my WM. But without the DoS. It just opened the tooltip, the mouse is inside the tooltip window so the original widget looses focus and the tooltip closes. repeat.
22:15:00 <mrvn> "I'm talking to someone from another planet." "So am I."