klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
nyah has quit [Ping timeout: 240 seconds]
rustyy has joined #osdev
<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
<geist> except not documented
Likorn has quit [Quit: WeeChat 3.4.1]
lainon has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gog has joined #osdev
<clever> > This applies to more complex dependencies. Consider the following code:
<clever> 
<clever> from the arm link pasted a few hours ago
<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?
<clever> > If the address is marked as Gathering (G), then the processor can, for example, merge two bytes writes into a single halfword write
<clever> the rpi's MMIO is almost entirely 32bit only, nothing bigger and rarely smaller, so thats definitely a case for non-gathering
<clever> and the few 16bit regs that do exist, have timing related bugs where transfers can be lost, so sticking to 32bit is best
<heat> does anyone know how uninitialised the qemu x86 machines are at boot?
<heat> like at the reset vector
<clever> heat: in terms of "motherboard" peripherals, cpu, or ram contents?
<heat> yes.
<clever> ram i think would be the simplest one to answer...
<clever> oh, and tcg vs kvm also comes into play
<heat> i found it though, qemu -S works
<heat> pci is uninitialized, the CPU as well (although I did see a weird value in EDX)
<heat> is this part of the initial x86 state? possibly
<heat> ram is inited yeah
<heat> then you're supposed to get more metadata from fw_cfg
<clever> all zero'd?
<heat> i think so
<heat> the fw isn't zeroing it
<heat> and I've never found garbage in RAM
<clever> hw/arm/virt.c: memory_region_add_subregion(mem, base,
<clever> ah, thats what i was looking for
<clever> 1704 memory_region_allocate_system_memory(ram, NULL, "mach-virt.ram",
<clever> this is what creates the ram itself
<clever> hw/i386/pc.c: memory_region_allocate_system_memory(ram, NULL, "pc.ram",
* heat nods
<clever> and now that i know the name, i can find it in x86 as well
<clever> and i think `info qtree` or something, will show you pc.ram
<clever> or `info mtree`?
<heat> i was trying to eyeball what would be needed for the simplest qemu firmware
<clever> include/hw/boards.h: * memory_region_allocate_system_memory - Allocate a board's main memory
<heat> pci bar allocation, chipset driver, fw_cfg driver
<clever> that file has a 20 line comment explaining it
<clever> my only complaint with fw_cfg, is that it has no support for dynamically adding it to a guest
<clever> so the machine definition must create a fw_cfg peripheral
<clever> (and the rpi doesnt)
<heat> the chipset driver probably has a way to set the PCIe bar or something
<heat> s/bar/allocation/
<clever> 25 * Memory allocated via this function will be backed with the memory
<clever> 26 * backend the user provided using "-mem-path" or "-numa node,memdev=..."
<clever> 518 memory_region_init_ram_nomigrate(mr, owner, name, ram_size, &error_fatal);
<clever> 1524 mr->ram_block = qemu_ram_alloc(size, share, mr, &err);
<clever> 2260 new_block->host = phys_mem_alloc(new_block->max_length,
<clever> 1446 static void *(*phys_mem_alloc)(size_t size, uint64_t *align, bool shared) =
<clever> heat: aha, there is a global func ptr, that all memory gets allocated via
<clever> only ever modified by one foreign target
<clever> qemu_anon_ram_alloc is the default implementation
<clever> util/oslib-posix.c:void *qemu_anon_ram_alloc(size_t size, uint64_t *alignment, bool shared)
<clever> and each os defines its own variant
<clever> i think its mmap'ing fd -1??
<heat> its anon memory no?
<clever> yeah
<clever> just a bit surprised that i dont see the man page explaining that
<heat> the fd field is only valid for file mappings
<heat> what else would you put there?
<clever> ah right, other flags could tell it to ignore the fd
<heat> MAP_ANONYMOUS does
<clever> 141 flags |= fd == -1 ? MAP_ANONYMOUS : 0;
<clever> bingo
<clever> the flag gets added if other code tried to mmap -1
darkstardevx has joined #osdev
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #osdev
eroux has joined #osdev
gamozo has quit [Quit: Lost terminal]
heat has quit [Remote host closed the connection]
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
troseman has quit [Ping timeout: 240 seconds]
chartreus has quit [Ping timeout: 240 seconds]
CryptoDavid has quit [Quit: Connection closed for inactivity]
gog has quit [Ping timeout: 260 seconds]
No_File has joined #osdev
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
gildasio has quit [Ping timeout: 240 seconds]
nur has quit [Ping timeout: 240 seconds]
gildasio has joined #osdev
osmten has joined #osdev
mahmutov has joined #osdev
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
vdamewood has quit [Client Quit]
<No_File> Back 2 ROOTS https://imgur.com/H36LTRV
<bslsk05> ​'C64 Browser' by [idk] (--:--:--)
vdamewood has joined #osdev
gildasio has quit [Ping timeout: 240 seconds]
wand has quit [Ping timeout: 240 seconds]
ripmalware has quit [Ping timeout: 276 seconds]
<geist> wow. libera is a year old?
<geist> did the. uh. event happen a year ago?
<kazinsal> I guess, dang
<kazinsal> yeah, seeing articles from the 19th last year about communities moving to libera
<clever> i discovered by accident, that leenode is allowing unregistered users in once more
gildasio has joined #osdev
<clever> after rebooting my system, my irc client auto-connected to it twice
<clever> i heard at one point, that you couldnt even connect without first registering on the website
<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
<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)
wand has joined #osdev
<geist> yah i wonder how the sister #osdev survived over there
<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
<geist> honeslty i hadn't really even thought about it in probably 6 months until today
<kazinsal> totes, freenode is pretty much ancient history in my mind at this point
<kazinsal> the Before Times so to speak
<Mutabah> The way I saw it, Libera _is_ freenode (the core of it at least, and many of the communities outright moved)
<vdamewood> It's like someone painted over the sign, and wrote Libera in its place.
<kazinsal> pretty much yeah
<geist> yah pretty amazing how well that transitioned over (at least in #osdev case)
<klange> New name, same people - staff _and_ communities
<geist> a few channels i follow went over to oftc, but as far as i can tell thats working fine too
<Mutabah> Biggest difference about libera: I OWN THIS CHANNEL, MUAHAHAHAHA
<clever> some fragmented to both matrix and libera
<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.
<vdamewood> There was a shakeup of owners in ##programming too.
<geist> omg dont go crazy on us Mutabah
<kazinsal> hah, yeah, at least with libera we know who the god emperor of the channel/org is
<vdamewood> geist: go? present tense?
<geist> i'm watching an open source project i've been following disassemble itself in real time right now (SIMH)
<Mutabah> ... I had forgotten until just then
<geist> and it's really not pretty
<kazinsal> geist: oh jeez, what happen
<Mutabah> vdamewood: Hey! I resemble that insult
<geist> it'sin the middle of exploding, which is a real shame
<vdamewood> Mutabah: Ad mit it, if you weren't nuts, you wouldn't be here.
<vdamewood> admit*
<Mutabah> geist: Oof, I just saw it on /r/programming
<geist> the guy that does most of the simh v4 work is throwing a super tantrum, and he controls the github repo, etc
<kazinsal> oh fun
<No_File> 010001110111010101110100011001010110111000100000010011010110111101110010011001110110010101101110
<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
<geist> but then the defacto project owner is throwing some tantrum now and basically trying to modify the license for petty reasons
<klange> We also took the 'opportunity' of this technically being a new channel to establish in its registration an official connection to osdev.org.
<geist> and lots of folks are having none of it
puck has quit [Excess Flood]
<geist> doesn't help that the original simh project was created by a guy that has no interest in open source, more or less
puck has joined #osdev
<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
<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
<kazinsal> hmm, yeah, that complicates things
<geist> so there was always 2 forks of it effectively
<vdamewood> I propose we call the split of Libera from Freenode, "the Forkening".
<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 :)
<geist> ugh, cable modem keeps resetting yay
<bslsk05> ​imgur.com: Imgur: The magic of the Internet
<geist> grats?
<kazinsal> reminds me, I need to buy a new lightning to 3.5mm adapter
<kazinsal> I swear the apple ones only last six weeks
<No_File> biggest trap in human history, the apple.
<mrvn> geist: changing a license is nearly impossible. It only takes one person disagreeing.
<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
<kazinsal> yeah, it looks more like an addition to the license that conveniently makes it non OSI compliant
<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
<kazinsal> it's almost a relicensing but questionably legally distinct
<geist> and folks are pointing out that's at best just a really dickish thing to do
<geist> ie, your license to his changes are revoked if you remove them or disable them, etc. really dumb shit
<mrvn> which would make it impossible to fix any bugs in the mentioned code.
<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
<geist> mrvn: right
<geist> folks are pointing out all sorts of issues, such as that
<geist> he's basically doing the equivalent of taking his toys and going home because of some disagreement about some feature he added
<geist> which is fine except he controls the repo and the github org and wont let anyone else do anythig about it
<mrvn> That's the point where I would just say: You go do that. We will just keep the existing version.
<geist> that's effectively where it's at. the community is probably going to fork it just before his changes
<mrvn> forking is easy
<geist> and he's basically 'go ahead, notice i have control of the main project that people will find'
<geist> sigh.
<mrvn> search engines qill change the ratings quickly based on activity on the repos.
<mrvn> s/qill/will/
<geist> well he *is* the main developer
<geist> by a long shot
<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
<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'
<geist> which may be legally okay, but just a really dicky thing to do
<geist> (or maybe not legally okay)
<mrvn> if there is even one commit from another person then that person can veto the license change. So not legally ok.
nanovad has quit [Ping timeout: 276 seconds]
<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
<geist> right, he's saying 'all changes my by past this commit where i have modified the license'
nanovad has joined #osdev
<geist> or something like that. anyway. whatever. it's just really silly and petty
<mrvn> which may or may not be legal. GPL doesn't allow that.
<geist> the main shame is it *is* the main developer
<mrvn> which is one of the reasons I like the gPL.
<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
<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
<geist> for future changes after a point, but then he has the main repo (github.com/simh/simh)
<bslsk05> ​simh/simh - The Computer History Simulation Project (269 forks/1393 stargazers/NOASSERTION)
<mrvn> geist: simh is already non-free. It has the advertising clause.
<geist> a semantic difference
<geist> folks use it in projects
<mrvn> But they aren't allowed to say so
<geist> say so what?
<mrvn> although, wait, it doesn't say simh must not be used, only the authors name.
<geist> yah it's the standard 'you can't use my name for advertising with stuff made with this' which seems fine to me
<mrvn> So I can say: My project uses simh. But not: My project uses simh by Robert M Supnik, Mark Pizzolato and others.
<geist> right. standard N clause BSD
<mrvn> well, if they don't want credit for their work. :)
<geist> sure. it's the nonsense he added tothe license file at the end of it that is setting everyone off
<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
<geist> which is <eyes roll>
No_File has quit [Quit: Client closed]
<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.
<mrvn> See "Group 2"
<mrvn> Line 66-68 in the license.txt is illegal. Can't change the license retroactively.
<mrvn> that makes the whole license invalid in many jurisdictions.
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mahmutov has quit [Ping timeout: 272 seconds]
gamozo has joined #osdev
eroux has joined #osdev
<gamozo> Wooo! Power is back!
<bslsk05> ​www.shutterstock.com: Cute Cartoon Kitten Taking Power Nap Stock Illustration 1790302490 | Shutterstock
<zid> where did you lose it?
Burgundy has joined #osdev
<gamozo> Somewhere right after the G4/G5. Naw, in seattle, lots of wind storms yesterday
<gamozo> I live in the middle of nowhere so if trees move a bit I lose power
<zid> we have an invention called holes
<mrvn> I'm so happy that germany has overland power cables above the tree tops and local power cable under the earth.
<gamozo> Apparently we tried to vote for that but everyone was against the higher prices
<mrvn> and now they pay for it with every storm
<zid> but.. holes are cheaper
<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)
<Griwes> not every storm, just the major ones :'d
<zid> employing a huge fleet of grounds managers is kinda pricey
<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
<zid> TCO
<gamozo> Way cheaper to get a generator than to redo infra
<mrvn> Nowadays they can shoot the cable through the earth without digging a trench.
<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
<gamozo> mrvn: They're doing that for my fiber right now! It's such a cool thing to watch
<zid> I can't imagine how many teams of guys your power companies must employ to trim hedges
the_lanetly_052 has joined #osdev
<zid> I've even seen them use helicopters to do it
<mrvn> flying a helicopter near power lines? not smart.
<gamozo> That's pretty much only for main lines, and that's pretty much pointless to bury
<gamozo> Those helicopter pilots are wild lol
<Griwes> even if you can shoot a cable through the earth, you still have to dig holes through, well, things
<Griwes> replacing a sidewalk or pavement has got to be more expensive than planting a few poles
<bslsk05> ​'Repairing Underground Power Cables Is Nearly Impossible' by Practical Engineering (00:13:34)
<zid> why would you do that
<Griwes> why would you do what
<zid> replace a sidewalk
<Griwes> if you need to punch down a hole for a junction or whatever
<mrvn> Griwes: for underground you pay once (in a long long time), a pole you pay frequently.
<mrvn> problem is: the pole already exists
<zid> making a hole in asphalt is a thing there exist billions of companies for and they do it cheap
<Griwes> yeah the problem is that for underground you need to pay it up up front
<zid> roadworks aren't new
<gamozo> It's really not that simple lol. Underground power is not easy/cheap
<zid> It is cheap, but it requires the companies involved not to be chasing quarterly reports
<zid> in order to look cheap
<mrvn> gamozo: I believe it's cheaper. It's just a big cost up front.
<Griwes> yeah. and sometimes "cheaper up front" just wins
<gamozo> Cheaper up front is kinda mandatory at least in the US, where it's just so massive and people are so spread out
<zid> Our government will probably find a way to sell the copper eventually
<mrvn> that's because the person doing it up front gets payed for building it and doesn't have to maintain it
<mrvn> What contract includes a 10-100 year maintainance cost?
<gamozo> I mean, I'll chagre you for maintainance for 10-100 years, but you won't get much for it ;)
nur has joined #osdev
<geist> gamozo: yah no power loss here on the island, but the network is going up and down
ethrl has joined #osdev
<mrvn> 2h without power, no problem. That's why laptops have batteries. 2h without network. OMG the world is ending.
<geist> right? i have a 20kW generator for power
<geist> but no network? what's the point!
<mrvn> I need an adaptor to power my FritzBox from USB.
<geist> huh its' actually a thing
<mrvn> you found a commercial one?
<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!
<gamozo> (me, justifying fiber to myself)
<mrvn> you think the hardware at the other end of the fibre has a generator too?
<gamozo> With the dedicated ethernet I'm getting that has an SLA, yes
<gamozo> With normal fiber, absolutely not
<mrvn> oh, pricey
<gamozo> Yes :( Very pricey. But I'm getting 4gbit full-duplex dedicated and I'm absolutely thrilled
<mrvn> thought you ment fibre vs copper
<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 :\
GeDaMo has joined #osdev
<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
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fwg has joined #osdev
jjuran has quit [Ping timeout: 256 seconds]
jjuran has joined #osdev
ethrl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ethrl has joined #osdev
vinleod has joined #osdev
vdamewood is now known as Guest4513
Guest4513 has quit [Killed (copper.libera.chat (Nickname regained by services))]
vinleod is now known as vdamewood
ethrl has quit [Read error: Connection reset by peer]
eroux has joined #osdev
<mrvn> Can I write std::array<int> a{1, 2, 3}; in some way?
<Mutabah> What's the context?
<mrvn> any C-style array with initilizer where I don't want to count how many items the array has.
<mrvn> (and want to get rid of the C-style array because they are bad)
<Mutabah> Is this in C++, or C? Are you thinking those braces are an array on their own?
<mrvn> obviously C++.
No_File has joined #osdev
<Mutabah> That's not a C array, it's an initializer for the `std::array`
<mrvn> Modern c++ has int a = 1 === int a(1) === int a{1} pretty much everywhere
<mrvn> Mutabah: the bad code is int *p = new int a[] {1, 2, 3};
<Mutabah> An
<Mutabah> *Ah
<mrvn> I can write std::array<int, 3> a{1, 2, 3}; but why should I have to count the items?
<Mutabah> Oh... right...
<Mutabah> Use vector? (the original code did allocate, for some reason)
<bslsk05> ​en.cppreference.com: deduction guides for std::array - cppreference.com
<klange> C++17 can apparently do `std::array a{1, 2, 3};`
<mrvn> ahh, right, stupid me. Why even give a type. But what if I want std::array<double> a{1, 2, 3}?
<klange> then start typing dots :P
<mrvn> that's fine for double. A lot of typing when it's some long winded constructor. :( I guess then I have to count.
<mrvn> or this: std::array c(std::to_array<short>({3, 2, 1})); // C++20 alternative, creates std::array<short, 3>
ethrl has joined #osdev
the_lanetly_052 has quit [Ping timeout: 276 seconds]
vdamewood has quit [Remote host closed the connection]
vdamewood has joined #osdev
ethrl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gamozo has quit [Read error: Connection reset by peer]
FatAlbert has joined #osdev
<FatAlbert> GeDaMo: how you doing ?
dostoyevsky2 has joined #osdev
<GeDaMo> OK
<FatAlbert> glad to hear
FatAlbert has left #osdev [WeeChat 3.5]
* vdamewood gives GeDaMo a porcupine.
<GeDaMo> I shall call him Spikey and hug and squeeze ... ow!
<vdamewood> GeDaMo: Go *with* the grain on one of those.
gog has joined #osdev
ethrl has joined #osdev
dennis95 has joined #osdev
<blockhead> GaDaMo: points for the Bugs Bunny reference :)
No_File has quit [Quit: Client closed]
nyah has joined #osdev
<GeDaMo> I thought it was an Of Mice and Men reference but OK :P
<blockhead> maybe BB referenced of mice and men
<GeDaMo> Probably, yes :P
<jimbzy> Yeah
KidBeta has joined #osdev
<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. :)
<kingoffrance> there was an old snl of mice and men :) ill throw in chrono trigger and woodland critter christmas re: porcupines
dude12312414 has joined #osdev
gog has quit [Ping timeout: 246 seconds]
<GeDaMo> There's a scene in Of Mice and Men where George hugs a rabbit to death :/
nog0x7cd has joined #osdev
<kingoffrance> yeah, the snl does that lol
lainon has joined #osdev
dude12312414 has quit [Remote host closed the connection]
Vercas has quit [Quit: buh bye]
Vercas has joined #osdev
sikkiladho has joined #osdev
gog has joined #osdev
<bslsk05> ​lobste.rs: Alternatives to rasberry pi | Lobsters
lainon has quit [Quit: Textual IRC Client: www.textualapp.com]
vdamewood has quit [Remote host closed the connection]
vdamewood has joined #osdev
No_File has joined #osdev
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
pretty_dumm_guy has joined #osdev
skipwich has quit [Ping timeout: 276 seconds]
skipwich has joined #osdev
ethrl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ethrl has joined #osdev
KidBeta has quit [Ping timeout: 260 seconds]
ethrl has quit [Ping timeout: 256 seconds]
Matt|home has quit [Killed (NickServ (GHOST command used by mattmob2!~mattmob@2607:fb90:903c:39a8:0:3d:7fc0:6a01))]
No_File has quit [Quit: Client closed]
No_File has joined #osdev
No_File has quit [Write error: Broken pipe]
ripmalware has joined #osdev
mahmutov has joined #osdev
dennis95 has quit [Quit: Leaving]
ptrc has quit [Remote host closed the connection]
ptrc has joined #osdev
haliucinas has joined #osdev
Matt|home has joined #osdev
ethrl has joined #osdev
muffin has joined #osdev
sonny has joined #osdev
sikkiladho has quit [Quit: Connection closed for inactivity]
<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
<bslsk05> ​godbolt.org: Compiler Explorer
xenos1984 has quit [Ping timeout: 272 seconds]
No_File has joined #osdev
<vdamewood> mrvn: It's only member is a pointer, not an array.
<vdamewood> err its
<vdamewood> sizeof(some pointer) is 8 on 64-bit systems.
<mrvn> ahh, it should be (*this)[i][j]
<mrvn> stupid precedences
<kingoffrance> yes, sizeof(a) 4 :)
<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.
<mrvn> Am I getting that wrong? Where is the error for converting int to int*?
<mrvn> ah *patsch* forgot the * in the front. *(int*) = int is fine.
gildasio has quit [Ping timeout: 240 seconds]
gog has quit [Ping timeout: 240 seconds]
Likorn has joined #osdev
jjuran has quit [Quit: Killing Colloquy first, before it kills me…]
jjuran has joined #osdev
sonny has quit [Remote host closed the connection]
sonny has joined #osdev
wootehfoot has joined #osdev
sonny has quit [Ping timeout: 252 seconds]
No_File has quit [Quit: Client closed]
No_File has joined #osdev
No_File has quit [Write error: Broken pipe]
ethrl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
psykose has quit [Remote host closed the connection]
psykose has joined #osdev
ripmalware has quit [Quit: Leaving]
ethrl has joined #osdev
ripmalware has joined #osdev
<mrvn> What's the syntax again to apply a parameter pack to a function?
<mrvn> (call f(x) for each x in the pack)
<Griwes> C++17 or before?
<mrvn> c++20
<Griwes> (f(args), ...);
<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'
ethrl has quit [Ping timeout: 246 seconds]
<mrvn> Matrix(Vec<U, N> v...) { ([&](auto &t){ ... }(v), ...); } operand of fold expression has no unexpanded parameter packs
<clever> CompanionCube: i have also had a string of what seem to be thermal shutdowns lately
<CompanionCube> clever: my issue is that replacements don't seem to be fitting, alas
<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
<clever> 10 amps on the cpu itself, not the wall
sonny has joined #osdev
<mrvn> nm, got it
eroux has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
heat has joined #osdev
<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()>?
<Griwes> For 1 you'd probably take a tuple and constrain its parameters to be same_as<type you want>
<Griwes> I'm not sure I understand "when T can construct blah" in 2
* geist yawns
<mrvn> Matrix m{{1,2},{3,4}} should do {Vec{1,2}, Vec{3,4}}
<mrvn> Or how do I deduce both rows and cols from the nested initializer list?
sonny has quit [Remote host closed the connection]
<Griwes> I don't think you can deduce like that, braced initializer do not have a type as expressions
<Griwes> Let me check tho
sonny has joined #osdev
mykernel has joined #osdev
<geist> if you deduced it, you produced it
<heat> haha C goes brrrrrrrrrr
<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
<mykernel> how do i force grub-mkrescue to generate mbr part table
<heat> use CSM if you have it
<heat> it's not the mbr nor the gpt
<Griwes> mrvn, yeah no, I don't think you can deduce that, because of the braced init expressions
<heat> the CSM will probably emulate text mode (probably, not sure)
<mykernel> laptop is x86 (32 bit)
<mrvn> https://godbolt.org/z/G59Maozxv Works for aggregate types :(
<bslsk05> ​godbolt.org: Compiler Explorer
No_File has joined #osdev
<Griwes> huh
<Griwes> it's probably the array doing magic
<Griwes> yeah it is
<heat> I use standard int types and size_t without std:: in C++
<heat> am I going to hell?
<Griwes> yes
<Griwes> your code won't compile under reaveros' stdlib
<jjuran> Just include <stdint.h> and <stddef.h>
<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
<mrvn> that would be cstdint and cstddef
<jjuran> No, those define types under std::
dude12312414 has joined #osdev
<heat> cstdint and cstddef also define them out of std:: iirc
<jjuran> They're allowed to but not required to
<Griwes> ^
<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
<bslsk05> ​github.com: reaveros/main.cpp at main · griwes/reaveros · GitHub
<heat> inb4 it's not UB
kingoffrance has quit [Read error: Connection reset by peer]
<Griwes> it sure is, it just so happens that this implementation defines its meaning :P
<jjuran> Some folks who inhabit C++ IRC channels live in a fantasy realm where C headers are deprecated
<heat> REPORTED TO THE COMMITEE
<Griwes> I AM THE COMMITTEE
<jjuran> heat: Spelling police! Pull over!
<heat> jjuran: Spelling-police police! Get your hands out of the vehicle!
<jjuran> You better stand down before someone calls the meta police
<heat> facebook.com police?
<jjuran> …
<jjuran> No.
<heat> using … is incredibly based
<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
<bslsk05> ​godbolt.org: Compiler Explorer
* jjuran still doesn't know what "based" means
<Griwes> its meaning is based
<heat> "1) true/factual. Used in political slang and used ironically in memes. "
<heat> "2) someone/something that is cool and/or speaks the truth"
<heat> according to the great source "Urban dictionary"
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
<Griwes> mrvn, yeah I think you'd need to have expression rewriting rules to make that work without the extra thing
<mykernel> exit
mykernel has quit [Quit: leaving]
No_File has quit [Quit: Client closed]
<Griwes> you could also have syntax like `make_matrix{...}.convert()` or something that *feels* better to my eyes, but ymmv
<heat> aw yeah syscalls work in IRC too?
<heat> fork()
<heat> I don't think it worked
<heat> I don't think it workedI don't think it worked
<heat> aw fuck
<heat> I tried
mykernel has joined #osdev
<mykernel> dumb question
<mrvn> Griwes: I tried AutomaticMatrix::operator Matrix<T, rows, cols>() but that doesn't get invoked on initialization
<mykernel> if cpu is x64 capable and bios/motherboard isnt
<heat> that's impossible
<mykernel> heat: what
<heat> the BIOS/motherboard have nothing to do with 64-bit vs 32-bit
<heat> if the chipset supports 32 and 64-bit CPUs, that's not a problem
<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
<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
<mrvn> template<typename... U> Matrix(U... u) : Matrix(AutomaticMatrix(u...)) { }
mahmutov has quit [Ping timeout: 244 seconds]
<mrvn> Shouldn't that deduce the parameter?
<Griwes> no
<Griwes> delegating ctors are just functions whose implementation delegates
<mrvn> The forwarded constructor deduces them.
<Griwes> they aren't transparent
<mrvn> delegated I mean
<heat> rust
wootehfoot has quit [Quit: Leaving]
mykernel has quit [Quit: leaving]
dude12312414 has quit [Remote host closed the connection]
<mrvn> Best I manage to achive is: Matrix a{M{{{1, 2}, {3, 4}}}}; If you want to play: https://godbolt.org/z/46vEqbvax
<bslsk05> ​godbolt.org: Compiler Explorer
<moon-child> lock()
<moon-child> lock()
<moon-child> I don'
<mrvn> moon-child has deadlocked
muffin has quit [Ping timeout: 260 seconds]
<heat> should've used RCU
sonny has quit [Remote host closed the connection]
Dyskos has joined #osdev
henistein has joined #osdev
chartreus has joined #osdev
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
<zid> I'm not sure a read-copy-update is going to help heat, as lmuch as you love them
GeDaMo has quit [Quit: There is as yet insufficient data for a meaningful answer.]
<mrvn> Griwes: stackoverflow suggested: Matrix(const T (&other)[rows][cols]); So same as my idea but no wrapper class around the C-style array.
<Griwes> Hmm, yeah, that's clever (in the positive way), assuming it works :p
ethrl has joined #osdev
<mrvn> clever: you are a C-style array, amazing. :)
<clever> mrvn: i am?
<mrvn> "that's clever"
<clever> ah, lol
<bslsk05> ​gitlab.freedesktop.org: amdgpu_cs_ioctl kernel null pointer when receiving v3d ioctl (#2018) · Issues · drm / amd · GitLab
<clever> mrvn: i'm also the one breaking the linux kernel
<clever> i managed to find a null pointer deref in my video driver
<clever> 2022-05-19 17:00:22 < airlied> it's like fuzztesting by accident
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
Dyskos has quit [Quit: Leaving]
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
<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:
<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
<mrvn> so now debug it, fix it and send a pull request
<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
<bauen1> mrvn: i reported it after i found it and it's already been fixed
<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
<bauen1> and i really wonder if that has been fixed, but at the time i couldn't find that out
Burgundy has quit [Ping timeout: 276 seconds]
<clever> in my case, the ioctl's for the v3d and amdgpu driver overlap
<clever> so userland things its issueing a DRM_IOCTL_V3D_GET_PARAM to query the ident registers on the hw
henistein has quit [Quit: Client closed]
<clever> but the kernel thinks its a DRM_IOCTL_AMDGPU_CS query
<mrvn> Do the NASA thing: Just don't do the thing that bugged.
<bauen1> clever: shouldn't improper ioctl generally not cause kernel bugs ?
<clever> and then everything goes horribly wrong, as the command is parsing garbage
<clever> bauen1: the ioctl is reused between many drivers
<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.
<clever> 2022-05-19 18:48:28 < clever> did the fuzzing miss it?
<clever> 2022-05-19 18:48:36 < anholt> the kernel probably wasn't fuzzed, which is a problem.
<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
<clever> seperately, i also found a DoS attack in chrome's rendering routines
<bslsk05> ​www.home-assistant.io: MQTT Discovery - Home Assistant
<clever> if you point the mouse at the "need help?" bit just right, the on-hover thing will flicker
<clever> the more tabs you have open, the more cpu usage that flickering causes
<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
<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.
<mrvn> "I'm talking to someone from another planet." "So am I."
sbalmos has quit [Ping timeout: 250 seconds]
sbalmos has joined #osdev
gamozo has joined #osdev
ethrl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ethrl has joined #osdev
kingoffrance has joined #osdev
ckie is now known as cookie
nyah has quit [Ping timeout: 260 seconds]
ethrl has quit [Read error: Connection reset by peer]
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev