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
<heat> C source 1 != C++ source 2
<heat> if you replace std::uint8_t& with std::uint8_t it optimizes it all out, business as usual
<heat> which is definitely something you should do, using references there is dumb
<mrvn> kaichiuchi: the register in the c++ are in a different order than in the C case
carbonfiber has quit [Quit: Connection closed for inactivity]
<kaichiuchi> I think we're all wrong
<kaichiuchi> I mean yes you're right
<kaichiuchi> but apparently there's still a bug
<heat> yes, i saw #llvm
<kaichiuchi> oh.
<kaichiuchi> *well*
<heat> although calling this a bug may be a bit rich
<heat> optimizers can have limits too
<kaichiuchi> I have to use a reference there because I need `reg.bc = 0xF00D;` to work like `reg.b = 0xF0; reg.c = 0x0D;`, because I'm using `reg.b` and `reg.c` as well
<zid> is gameboy?
<kaichiuchi> yes
<mrvn> kaichiuchi: clang is bad at optimizing out unused variables in structs.
<zid> yay gameboy
<kaichiuchi> wait a minute I know you
<kaichiuchi> aren't you from the gameboy discord?
<zid> yes
<zid> no
<zid> I was on the emudev one for a bit
<kaichiuchi> that's where
<heat> zid is from the femboy discord
<zid> I can't stand beware so no gb discord
<kaichiuchi> ah, we're on the same page.
<zid> You'd think he'd chill out in 15 years but nope
<heat> is he the emudev heat
<kaichiuchi> but yeah, I'm just trying things out at the moment
<kaichiuchi> I made the mistake of thinking operator overloading might be the "C++ solution" to just doing it the C way
<mrvn> kaichiuchi: what is the point of defining the register pairs as references to other class variables?
<zid> I didn't even bother with the regpair stuff in mine because I hadn't benched it, and I assume it might actually just cause contention
<zid> i.e lots of code using c and d as different registers might prefer c and d to not be on the same l1 tag or something, who knows
<zid> err b and c*
<zid> and ryzen 2 and 4's memory renamer might not like mixing word and byte accesses
<kaichiuchi> because then, `reg.bc = 0xABCD;` will be `reg.b = 0xAB;` and `reg.c = 0xBD;`, and I need to access two 8-bit bytes sometimes as 1 16-bit register
<zid> so I just left it alone as a macro that recombines them
<zid> if the memory layout ends up 'correct' it can optimize it to a short, but if not I am not worried
<kaichiuchi> oh
<kaichiuchi> I see what you're saying
<zid> set_BC(0x1234); for reg.b = 0x12; reg.c = 0x34;, rather than punning BC to char[2] constantly, and the compiler is free to turn that back into a *((short *)) if it *wants to*
<zid> if I wanted mega-top speed it'd be a dynarec anyway
<kaichiuchi> I'm really just micro-optimizing at this point how I want to handle the registers
<zid> clearly the solution is
<mrvn> zid: if it's a union then the compiler knows the alignment is right. Not relevant for x86 but for other archs.
<mrvn> kaichiuchi: you are missing a lot of constexpr and const correctness
<zid> char register B asm("bh"); char register C asm("bl"); short register BC asm("bx");
<kaichiuchi> yes
<zid> in every TU
<kaichiuchi> that's all well and good
<kaichiuchi> but it was supposed to be a demonstration
<kaichiuchi> frankly I'm torn between writing this in C or C++
<heat> zid, totally, JITing would be the best
<heat> kaichiuchi, have you considered
<mrvn> kaichiuchi: also the gcc code is only this short because you example is so limited.
<kaichiuchi> i mean... yes, it's short
<heat> RUSTRUSTRUSTRUST RUST SUR SUTS UTSU CARGO RUSTU RUST RUST CARGO
<kaichiuchi> no
<zid> you forgot 'cult' after 'cargo', heat
<heat> CAN YOU WRITE IT IN RUST
<mrvn> kaichiuchi: a real use of the cpu struct will use all the regs and then you get the long code clang produces.
<heat> OR WRITE IT IN C AND THEN REWRITE IT IN RUST
<kaichiuchi> the point being, *for this particular example*, clang was generating crap
<kaichiuchi> in the real world, yes, you're right
<zid> tbh a gb emulator is tiny, it's 99% figuring out which testcases you fail etc, rather than masses of code, you could probably maintain both
<heat> your fault for not constexpring
<zid> pretty trivially
<zid> and make a cool blogpost about having done so
<kaichiuchi> zid: you see, I want to port this to my eval board
<mrvn> kaichiuchi: compilers aren't optimized for stupid made up examples. So who cares?
<kaichiuchi> then I have no idea why we even use godbolt
<kaichiuchi> otherwise I'd just dump the entirety of my code on there and call it a day
<kaichiuchi> but no one does that, because that's not the point
<heat> well, this example is silly because you're expecting the compiler to see through a bunch of C++ and hope it optimizes everything out
<mrvn> kaichiuchi: it's fine to try out minimal test case. Just don't complain when some made up case doesn't quite do what you want.
<zid> That's what C++'s for heat
<kaichiuchi> gcc saw through it
<heat> ok
<zid> seeing how much boilerplate you can get the compiler to eliminate
<zid> with your sufficiently clever compiler
<mrvn> +1 for zid
<kaichiuchi> so, I'm not really sure what the point of that was
<zid> without actually gaining any compile time encapsulation in exchange
<heat> i guarantee you your gameboy emulator is not going to have CPU c; c.reg = rand(); printf("%x", c.reg);
<kaichiuchi> yes, I can guarantee it as well
<zid> Mine does
<mrvn> kaichiuchi: you need to make the Registers abstraction zero-cost by writing it right.
<heat> you see my pushf; pop <> rant is valid because 1) I'm the one ranting; 2) this is actually a problem in real codegen
<heat> there are no zero-cost abstractions
<zid> heat: less bitching, more adding sound or a schd to my emu
<heat> i don't write weird birds
<heat> except for the emu war
<kaichiuchi> mrvn: thanks, but again, this wasn't at all a "standard" version
<kaichiuchi> this was "hey I noticed something odd"
<kaichiuchi> besides, no one can write C++ right
<mrvn> kaichiuchi: just saying. If you add a bunch of references you store in the class then it's not too surprising the compiler will initialize them all in the constructor as you specified.
<kaichiuchi> there are 50 million ways to do things and none of them are right
<heat> which is why you write things in
<heat> RUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUSTRUST
<kaichiuchi> please don't say it
<zid> Have you tried my One True Way to Write C++(tm)
<zid> It's a Safe Subset(tm) that I will teach you via my new book
<zid> only $49.95
<heat> so if you want a gameboy emulator you just grab the gb-emu crate from cargo
<geist> right, solution for all 'too many ways to do a thing' is to define another way
<heat> geist, RUST!
<zid> (version 2)
<kaichiuchi> even in C it can get annoying
<kaichiuchi> but the number is 10 million
<zid> version 1 had some mistakes, and is no longer the one true way
nyah has quit [Quit: leaving]
<mrvn> kaichiuchi: aliasing is the biggest obstacle
<kaichiuchi> yes
<heat> kaichiuchi, write it in enterprise OOP C#
<kaichiuchi> no
<zid> Oh yes please
<heat> Factory that biatch
<mrvn> heat: a gb-emu factory?
<kaichiuchi> listen, I just want to write an efficient gameboy emulator that can run on my stupid eval board that I got for free
<mrvn> hehe, great minds ...
<bslsk05> ​github.com: JADE/InstructionManager.cs at master · BLNJ/JADE · GitHub
<zid> We need someone to surpass this
<mrvn> kaichiuchi: why? Is your board so slow it can't emulate a gameboy with inefficient code?
<kaichiuchi> it's like... 40MHz
<zid> how many regs does it have?
<mrvn> what speed was a gameboy?
<kaichiuchi> 4.194304MHz
<kaichiuchi> zid: good question, I actually don't know
<zid> I mean.. surely what the best approach is
<mrvn> kaichiuchi: so you need to use less than 10-20 opcodes per emulated opcode. that doesn't sound too bad.
<zid> is to make a VERY specific implementation that abuses the quirks of the target
<zid> and cheats as much as possible on the gameboy side
<kaichiuchi> i come here for something almost unrelated and now I get advice
<kaichiuchi> i am home
<zid> I mean, we wanna have fun too
<zid> not just you
<kaichiuchi> there's no fun in programming
<kaichiuchi> only sorrow
<heat> zid, I feel like that's a challenge but I can't go enterprise that hard
<zid> like I'd be amazingly surprised if you could get away without per-frame rendering
<mrvn> kaichiuchi: have you considered compiling the gameboy code to your cpu instead of emulating?
<mrvn> like rosetta
<kaichiuchi> no, I haven't
<heat> that's not going to easily work I think, because of self modifying code
<kaichiuchi> because of se- yes
<zid> there's a ti-80 jit for gameboy
<mrvn> right, gameboy games probably have stupid copy/cheat protection like that
<zid> it's super limited on ram though so it doesn't do very advanced tricks
<zid> not a lot of blocks can exist
<kaichiuchi> zid: i saw that at work today
<heat> rosetta can just say "we don't transpile self modifying code" which is mostly ok
<mrvn> heat: rosetta2 handles self modifying code. it's just not as fast
<zid> gb doesn't have a lot of self modifying code per-se, but sprite DMA requires running code out of ram which was likely memcpy'd there
<mrvn> (from what I read)
wxwisiasdf has quit [Quit: leaving]
<zid> enough if()s solves all that though
<kaichiuchi> still wondering whether or not I should even bother trying to do this in C++
<mrvn> zid: do you too write all your code as "while(true) { if ...; if ...; if ...; if ...; }?
<kaichiuchi> it scares me
<heat> i have given you plenty of ideas
<kaichiuchi> i'm not writing it in rust
<heat> enterprise C#
<kaichiuchi> you know, I'm going to tell all of you a secret
<kaichiuchi> a very long time ago, when I was 13-14 I used to idle this channel a lot, I'd talk a few times
<heat> nooooo kaichiuchi this is a public channel
<kaichiuchi> i'm 27 now
<kaichiuchi> and I still remember you
<heat> same weirdos, different day
<kaichiuchi> in fact I remember all who are speaking except for zid
<zid> I am both newer and older than all things
<zid> I have existed for all of eternity, and am brand new
<heat> i wasn't here 13 years ago
<kaichiuchi> then maybe it was a bit later
<zid> aka I've been on irc for ages but #osdev is a fairly recent addition
<kaichiuchi> but I definitely remember you
<kaichiuchi> see the problem is if I use C++ I'll be too tempted to try and write some stupid std::array<> thing
<heat> step 1: don't
<mrvn> kaichiuchi: so?
<kaichiuchi> that's so much time wasted
<heat> step 2: write a bash script to shock your electric collar if you try to #include <array> OW
<heat> mine just shocked me
<zid> How little I care about perf: I memcpy for bankswitches
<kaichiuchi> I could write analogues for std::array, std::move, std::function, etc etc etc
<kaichiuchi> but that's... so much time
<heat> std::array is bad
<heat> std::function is ungood
<gog> std::meow
<kaichiuchi> if I write C, there are things I will unfortunately miss from C++
<zid> std::coloncolon
<heat> gog
<heat> gog
<heat> gog
<mrvn> heat: what's wrong with array?
<gog> heat
<heat> bazinga
<gog> hhhhhhhhhhhhhhhh
<kaichiuchi> *careful* use of templates, compile-time evaluations...
<gog> RAII
<heat> *laugh track*
<kaichiuchi> yes
<mrvn> kaichiuchi: I think if you need std::move you did something wrong
<kaichiuchi> I was just saying things
<gog> unless you're reimplementing unique_ptr
<FireFly> zid: excuse you, I believe it's called PAAMAYIM NEKUDOTAYIM
<heat> mrvn, std::array<Type> = [a, b, c]; doesn't work
<mrvn> gog: want to dynamically allocate and pass around gameboy cpu states?
<heat> the fact that a better array was only invented as a fucking STL type is also depressing
<mrvn> heat: but std::array<Type> arr{a,b,c}; does
<gog> yes
<mrvn> sometimes
<mrvn> std::array arr{a,b,c}; is the real gem
<kaichiuchi> point being though, I don't feel like implementing parts of the STL
<heat> mrvn, no it does not
<kaichiuchi> I could use a plain C array but then people will bitch
papaya has joined #osdev
<gog> not me
<mrvn> heat: which one?
<bslsk05> ​godbolt.org: Compiler Explorer
<gog> fuck memory safety
<kaichiuchi> as far as I know, portable C++ is basically without 90% of the STL
<kaichiuchi> and by "portable" I mean to shit like STM32 boards
<bslsk05> ​godbolt.org: Compiler Explorer
<heat> you're not exactly making the case for std::array here
<mrvn> kaichiuchi: use freestanding - rtti - exceptions
<mrvn> heat: why do you want to type a pointless "<int>"?
<heat> yeah, who needs types
<kaichiuchi> i disable rtti and exceptions as it stands now anyway
<heat> ints, longs? same shit
<gog> implicit type promotion
<heat> I can't wait for c++23 fully dynamically typed all auto no types
<gog> yes
<gog> fuck types
<gog> c++.NET
<mrvn> heat: c++20 arrays lack a template deduction guide for specifying the type but not the number.
<heat> and then C++26 when they remove "int f()" for "auto f() -> int"
<kaichiuchi> god I might even end up having to write my own std::span
<gog> heat: wait stop
<gog> you're making rust
<kaichiuchi> what more can god take from me
<heat> and best practice would be "auto f()" as a template which gets instanciated every time you call it
<mrvn> heat: and even if you have that you don't get type conversions if you mess up the types, e.g. int vs. long.
<heat> mrvn, yes. c++ arrays are bad
<kaichiuchi> GOD
<kaichiuchi> decisions are hard
<mrvn> heat: they aren't a magic fix for bad code.
<heat> C++ arrays aren't even a fix for C arrays
<mrvn> we have to disagree on that one
<gog> C arrays do not need fixing
<gog> your code needs fixing
<heat> they do, they could use a .begin and .end
<kaichiuchi> god.
<kaichiuchi> i've missed this place.
<mrvn> C arrays are 2nd class, if you can even call them that
<heat> for nice "for (auto val : c_array)"
<gog> bounds checking
<heat> fuck bounds checking
<heat> what is this, rust?
<gog> i will not program in rust, not out of principle, but because it's trendy
<gog> this is my emotional support unnececssary contrarianism
<mrvn> heat: c arrays convert to spans which you can "for (auto ...)"
<heat> anyway in C++29 we'll introduce a new function declaration syntax "fn f()" and make everyone switch to that as best practice
<heat> and a new keyword let to declare variables
<kaichiuchi> you really hate C++, huh?
<gog> heat my brother in christ
<mrvn> heat: "let" is like "auto" but you don't have to initialize the var right there. it will find the right type later when you use the var. :)
<heat> see, it's way better, which is why it needs a separate keyword
<gog> i love c++
<heat> OR, wait a fucking minute, an STL template
<gog> yes
<gog> template metaprogram everything
<heat> we could build it as part of the language, BUT writing something in C++ stl is way more satisfying
<papaya> I picked a hell of a time to come back on here this conversation is cursed
<heat> also in C++29 there will be a draft of a draft of a technical preview of a tentative standard pending approval for networking
<kaichiuchi> I think heat is having a breakdown
<kaichiuchi> but it's not necessarily unjustified
<mrvn> heat: c++29 will support the galactic net.
<heat> I don't breakdown, I breakup
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
papaya has quit [Quit: leaving]
Ellenor has joined #osdev
<sbalmos> I have to wait until C++35 to add random 'a, 'b, 'static, '"? marks? boo
<mrvn> sbalmos: lets resurrect trigraphs
<mrvn> and don't you mean 'a, `a and ´a?
<sbalmos> mrvn: No I meant 'a, 'A, and 'eh
<mrvn> 'a is the start of a character literal so no go
<sbalmos> \'a
<Mondenkind> what did I walk in on
<bslsk05> ​twitter: <zhuowei> fuck "rust". everything i write is unsafe. raw pointers without the bounds. no, i will NOT check for overflow. string dot h. i live for this
<mrvn> (-1)??(x:>
gxt has quit [Remote host closed the connection]
<Mutabah> I've written some almost-100% unsafe code rust recently... wasn't too bad
gxt has joined #osdev
<sbalmos> strcpy() ftw, enforced safety is overrated
<Mutabah> Probably wildly unsound, should have used C++ via FFI for those bits...
<mrvn> and once again it shows that is a language has some bad feature it will be used
<mrvn> s/is/if/
<sbalmos> transmute() ftw
<zid> I prefer to use strncpy but just guess that n should be
<zid> or set it to MAX_INT to keep my options open
<sbalmos> n = str.len, screw multibyte chars
<mrvn> strncpy might be even worse. It suggests safety but: "If there is no null byte among the first n bytes of src, the string placed in dest will not be null-terminated." So totaly broken.
<mrvn> you always have to pass one less than the size to strn*
<mrvn> You rather want BSDs strlcpy()
<sbalmos> wcsncpy()
<mrvn> string::copy<wchar>?
<kazinsal> system("shutdown -h now")
<kazinsal> guaranteed safer than using a standard library for handling C strings
<mrvn> with open("/proc/sys/kernel/sysrq") as FD: FD.write("b")
<sbalmos> mrvn: access denied
wxwisiasdf has joined #osdev
<wxwisiasdf> good morning people of the development systems that use resources of the computer to operate on the system
<mrvn> what about the rest of us?
<wxwisiasdf> yes
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
chartreuse has joined #osdev
gog has quit [Ping timeout: 268 seconds]
[itchyjunk] has quit [Remote host closed the connection]
<geist> Noice
<geist> Re: safe strcpys, I know it’s not a goal here but I do wonder how much of a performance loss (or gain) it is to use the length terminated ones over a plain stripy, assuming fully optimized versions per arch
<zid> main issue isn't the n check it's the strlen you have to do to generate it if you lost the n somewhere
<mrvn> A single strlen() call will make up for the tiny loss in speed on having to check the extra length word.
<mrvn> just length prefix strings
<zid> then again, if you're using strcpy, you already know the upper bound, and that's good enough
<mrvn> zid: if you have to do strlen then using strn* or strl* is a bit pointless.
<zid> exact n is memcpy, strncpy is bounded strcpy I guess
<mrvn> strn* is for when you know the amount of space you have, not the length of the string.
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
<sbalmos> Pascal was length-prefixed IIRC?
terrorjack has joined #osdev
<sbalmos> I forget how rust internally does it, since they base len off utf-8 codepoints
<Mutabah> `string.len()` is the UTF-8 code unit (i.e. byte) length
<Mutabah> `.chars().count()` for the number of codepoints
MarchHare has quit [Ping timeout: 255 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #osdev
gxt has quit [Ping timeout: 255 seconds]
Vercas6 has quit [Ping timeout: 255 seconds]
DonRichie has quit [Quit: bye]
DonRichie has joined #osdev
Vercas6 has joined #osdev
gxt has joined #osdev
DonRichie has quit [Quit: bye]
DonRichie has joined #osdev
bradd has joined #osdev
heat_ has quit [Remote host closed the connection]
heat_ has joined #osdev
DonRichie has quit [Quit: bye]
DonRichie has joined #osdev
Burgundy has joined #osdev
MarchHare has joined #osdev
wxwisiasdf has quit [Ping timeout: 248 seconds]
carbonfiber has joined #osdev
kori has quit [Ping timeout: 255 seconds]
JTL1 is now known as JTL
Brnocrist has quit [Ping timeout: 268 seconds]
k4m1_ is now known as k4m1
nj0rd has quit [Quit: WeeChat 3.7]
nj0rd has joined #osdev
eroux has quit [Ping timeout: 246 seconds]
eroux has joined #osdev
dza has quit [Remote host closed the connection]
dragestil has quit [Read error: Software caused connection abort]
dragestil has joined #osdev
V has quit [Read error: Software caused connection abort]
V has joined #osdev
dza has joined #osdev
cyao has joined #osdev
<cyao> What does "Location of extent" mean?
GeDaMo has joined #osdev
<Mondenkind> context?
cyao_ has joined #osdev
cyao has quit [Read error: Connection reset by peer]
<cyao_> in iso 9660
<cyao_> why do i have a _ in my name
cyao_ is now known as cyao
nick64 has joined #osdev
<cyao> the location of extent in Directory entry
<kazinsal> extent usually means block in filesystems
<nick64> Did the ioremap class of functions get removed from the Linux kernel?
<kazinsal> so in ISO 9660 "extent" probably means "starting block/sector"
<j`ey> nick64: no
<kazinsal> nick64: ioremap_nocache was deprecated a few years ago, that's all I know of
<nick64> I am seeing this ```12:17: error: implicit declaration of function
<nick64> "toremap
<nick64> [-Werror```
<kazinsal> you have misspelled ioremap
<j`ey> toremap?
<nick64> Oh wait that is not code error, that is OCR error in screenshot
cyao has quit [Remote host closed the connection]
<j`ey> maybe you didnt include a header?
<kazinsal> you should be including asm/io.h
<nick64> Oh it is not uaccess.h?
<j`ey> or jus linux/io.h
<j`ey> uacces.. is user access
<kazinsal> I feel like ioremap is specifically a kernel thing
<nick64> Got it
immibis has quit [Read error: Software caused connection abort]
y0m0n has joined #osdev
Burgundy has quit [Ping timeout: 260 seconds]
Burgundy has joined #osdev
y0m0n has quit [Ping timeout: 260 seconds]
<kaichiuchi> hi
<GeDaMo> Hi kaichiuchi :)
spikeheron has quit [Quit: WeeChat 3.7]
nyah has joined #osdev
spikeheron has joined #osdev
eroux has quit [Ping timeout: 260 seconds]
eroux has joined #osdev
rorx has quit [Ping timeout: 256 seconds]
bradd has quit [Ping timeout: 260 seconds]
rorx has joined #osdev
Burgundy has quit [Ping timeout: 248 seconds]
eroux has quit [Ping timeout: 252 seconds]
eroux has joined #osdev
Matt|home has quit [Quit: Leaving]
heat has joined #osdev
heat_ has quit [Read error: Connection reset by peer]
nick64 has quit [Quit: Connection closed for inactivity]
carbonfiber has quit [Quit: Connection closed for inactivity]
eroux has quit [Ping timeout: 260 seconds]
eroux has joined #osdev
Ali_A has joined #osdev
divine has quit [Ping timeout: 252 seconds]
dude12312414 has joined #osdev
Burgundy has joined #osdev
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
<heat> kaichiuchi, have you been studying OOP patterns for your seesharp emulator?
<kaichiuchi> no.
<heat> then do it
<heat> oh, new idea: write it in K&R C
<heat> identifiers get 8 chars max
<kaichiuchi> man are you on drugs
<mjg> kaichiuchi: fentanyl
<heat> im high on life
<mjg> i told him like 8 times to stop
<mjg> and he just pops another pill in response
<heat> go on a date with me and I'll stop
<kaichiuchi> i don’t have my mac at work with me so i can’t work on it anyway
<heat> I pop pills to handle rejection
<kaichiuchi> (i have nothing to do at work)
<heat> >mac
<heat> man are YOU on drugs
<kaichiuchi> no
<kaichiuchi> well, yes
<kaichiuchi> escitalopram 5mg administered daily
<zid> which gender does that make you
<kaichiuchi> male
<kaichiuchi> it’s a simple antidepressant
<mjg> i'm on an antiperspirant
<mjg> heat: i told you like 3 times i'm strictly straight
<mjg> 's like, not negotiable
<zid> yea but heat's flexi
<zid> his gender is football
<mjg> so you guys seen https://github.com/froggey/Mezzano
<bslsk05> ​froggey/Mezzano - An operating system written in Common Lisp (180 forks/3283 stargazers/MIT)
<mjg> pretty crazy
<mrvn> zid: sex: [ ] male [ ] female [ ] yes, please
<zid> froggey might ahve
<mjg> oh heh, that's a person here
<mjg> i guess should have checked, osdev is not that too big of a world
<kaichiuchi> you have to be a little crazy
<bslsk05> ​'Crazy' by Seal - Topic (00:05:57)
brynet has quit [Quit: leaving]
Brnocrist has joined #osdev
<froggey> yeah, i've seen it
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
dude12312414 has joined #osdev
<froggey> mjg: did something happen? is it on hn or r/programming again D:
<mjg> i don't know, got it linked one channel over
Terlisimo has quit [Quit: Connection reset by beer]
<froggey> lol, alright. I'm always curious about how it spreads, every now and then someone pops up here and says "hey check this out"
brynet has joined #osdev
<mrvn> "You can wear glasses, then you /look/ smarter"
<mjg> froggey: have you ever tried benchmarking it?
<froggey> yep, there's a common lisp benchmark suite somewhere I tried a while ago
<froggey> results weren't amazing, but generally not terrible either
<froggey> (gc performance is bad tho)
<mjg> i'm comparing hobby oses for lulz and no profit
<mjg> can you whip out a syscall bench?
<froggey> what's a syscall?
<mjg> getpid or an equivalent
<mjg> somehting which switches to the kernel but does next to no work there and gtfo's back
<froggey> what's a kernel?
divine has joined #osdev
<froggey> sorry, I'm teasing. there's no kernel and no user/kernel boundary to jump, so no syscalls
<froggey> security model is basically the same as templeos, but with language-provided bounds/type checking everywhere
<mjg> heh
Terlisimo has joined #osdev
<mjg> is your middle name terry?
<mjg> :]
<froggey> nooope
<mjg> you should work on it
<froggey> changing my name? not again, it's a huuuge pain lol
<mrvn> But you could be frogger
<mjg> now the real q is if an OS like that should be on your CV
<mjg> or contrary, not linkable to your real name
<froggey> it is and got me hired!
<mjg> where
<froggey> not telling
<mjg> cause they don't know about the os!
<froggey> eh? they do know about it and I gave an internal talk about it
<kaichiuchi> I’ve been told I have to give an internal talk about one of my projects
<kaichiuchi> and I’m terrified
<kaichiuchi> fortunately that isn’t going to happen until this time next year
<FireFly> I wish I still had projects lol
<kaichiuchi> the gameboy emulator i’m working on is supposed to work on an eval board my coworker gave me
<mjg> kaichiuchi: what are you terrified of
<kaichiuchi> i don’t do well with public speaking
<mjg> sounds like you got time to practice
<kaichiuchi> or speaking to an audience in general
<kaichiuchi> yes
<mjg> are you worried about hecklers?
<kaichiuchi> no
<mjg> you shy or what
<kaichiuchi> shy
<mjg> got no cure for that one
<kaichiuchi> indeed
<mrvn> "imagine everyone in the audience naked", Yeah, that is going to help.
<mjg> you see 50 dicks without imagining they are naked
<mrvn> and if there are chicks then imagining them naked isn't going to help either.
<kaichiuchi> it might
<kaichiuchi> also, I swear docker is a mix between goodness and badness
lanodan_ is now known as lanodan
Ali_A has quit [Quit: Client closed]
xenos1984 has quit [Ping timeout: 246 seconds]
xenos1984 has joined #osdev
gog has joined #osdev
kori has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
immibis_ has quit [Ping timeout: 268 seconds]
immibis_ has joined #osdev
xenos1984 has quit [Ping timeout: 256 seconds]
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
MiningMarsh has joined #osdev
<heat> a lisp OS? in your CV? you're about to get hired by the FSF to work on emacs
<netbsduser`> ah, it's froggey
<netbsduser`> i've been following mezzano os with keen interest
<heat> yo netbsduser`
<heat> I need your expertise as a netbsd user
<netbsduser`> evening heat, i should be glad to oblige
<heat> how do python shebangs work if apparently netbsd doesn't have /bin/python3
<netbsduser`> the usual approach is #!/usr/bin/env python3
<kaichiuchi> i wanna go home
<netbsduser`> most people will not change the default package directory from `/usr/pkg` so you could just do `/usr/pkg/bin/python3` but this way is hopefully portable
<heat> well, the thing is that apparently python3 isn't a thing in netbsd python3 packages/ports/whatever
<kaichiuchi> :(
<heat> which is, you know, something I'm kind of doubting but this dude came to edk2 and said netbsd didn't have a python3 binary anywhere? which is fucking crazy
<netbsduser`> oh, that's a fair point, do most linuxes have python = python2?
<kaichiuchi> no
<kaichiuchi> that would be distressing
<heat> arch has python = python3 since forever, and removed python2 from the repos a few months ago
<heat> brb gotta reboot
heat has quit [Remote host closed the connection]
<kaichiuchi> the heat is off
heat has joined #osdev
* heat googles how to install a package in $BSD_VARIANT for the 300th time
<netbsduser`> i can't think of an immediately good answer to the shebang problem, i have `python3.10` and a symlink `python` to it
<netbsduser`> it would be tempting to say just `/usr/bin/env python` would be fine but no doubt there exist many OSes where that is going to be python 2
<heat> so you don't have a python3 at all?
<heat> as in /usr/bin/python3 or whatever
<netbsduser`> unfortunately not, if it's common on other systems then i could suggest to pkgsrc maintainers to make that symlink
<heat> wtf
<heat> so, again, how does any shebang work at all?
<heat> if you don't have a common name to call $PYTHON_INTERP
<heat> like, /usr/bin/env python3 doesn't solve this, because there's no python3 anywhere
xenos1984 has joined #osdev
<netbsduser`> pkgsrc includes a lot of scripts, among which are those that translate shebangs intended for other systems to fit with pkgsrc (usually replace `/bin/cmd` with `/usr/bin/env cmd`)
<netbsduser`> for python they do the needful according to the package description's preferred python version
<heat> what the actual fuck
<heat> freebsd doesn't have python nor python3 either
<gog> oops
<heat> so like, you can't use anything that hasn't been sed'ed to hell by pkgsrc?
<netbsduser`> well, in practice i think a lot of people will just make a symlink themselves
<heat> something something sane by default
<kof123> hmm...is there some LFS or whatever filesystem layout that "conforming" systems adhere to? i mean, not taking a side, but hard for me to see anything but conventions here
<kof123> ^^^ is there any standard?
<kof123> or is it all ad hoc? what guarantees anyone ship python?
<heat> everyone disagrees on the filesystem layout
<gog> mood
<gog> every filesystem layout is objectively wrong
<heat> shut up im right everyone who disagrees is wrong
<mrvn> netbsduser`: linuxes generally don't have any python anymore (RH, centos, alma, debian, ubuntu, ...)
<gog> that's right
<mrvn> netbsduser`: They used to have a python + python3 but python got renamed to python2 so you always specify the version you need
sortie has quit [Ping timeout: 260 seconds]
<heat> python3 is explicitly provided by cpython itself. BSD systems reject it for $REASON
<heat> I guess they want to be able to install multiple pythons? but what a fucking chaos that is
<mrvn> then what do they call python3?
<heat> nothing
<heat> you only have python3.specific-version
<heat> this is insane
<mrvn> heat: so they call it python3.x. stupid but ok.
<heat> right. how does a script invoke python3?
<mrvn> don't they have alternatives or default versions for a release?
<heat> apparently nto
<heat> not*
<mrvn> must be fun to upgrade
sortie has joined #osdev
<gog> hi
<gog> should i use musl
<heat> HELLO SORTIE
<heat> PYTHON YES OR NO
<heat> gog, i dunno musl for what
<gog> my userspace
<heat> your OS? or your actual installed operating system
<mrvn> heat: maybe they have a binfmt-misc that detects the python shebang and starts the python3.x instead?
<gog> my os
<heat> erm, sure
<gog> what if i wrote my own libc instead
<heat> it's a solid libc. a bit too linux centric so you need to hack around that, but solid
<gog> oh what's a not linux centric
<netbsduser`> heat: that's interesting, if it makes such a symlink in its own install process it would be removed by pkgsrc because it might conflict with multiple python3 versions being installed at once
<netbsduser`> but it seems like a good reason to have pkgsrc maintain a symlink
<mrvn> netbsduser`: that's what Debian has alternatives for
<kof123> probably not comparable...but a long time ago in a ports release far away, there were seemingly-similar things re: which "java" command to run (whether built from source, or binaries) ...i believe there was just a "java" wrapper script, and if you didn't like the default, set an environment variable which version of jdk/jre to use is that a good idea? i don't know, just throwing it out there
<netbsduser`> gog: i used mlibc which i found to be a delight
<mrvn> netbsduser`: every deb provides the alternative with a priority and the system creates the symlink and the user can change priorities
<kof123> *IIRC you just set an env var
<sortie> HEAT BEHOLD THE SNAEK
<gog> m'libc
* gog tips fedora
<netbsduser`> it's from the managarm project, but they ported it to Linux to work on debugging it then span it off into an independent library
<mrvn> netbsduser`: an alternative solution is to have a meta package python3 with just the symlink and a dependency on one python3.x
<netbsduser`> mrvn: i like debian's alternatives system but the latter is the more idiomatic approach in pkgsrc
<netbsduser`> i think it would be reasonable if i sent a PR for the latest python3 to make a python and python3 symlink
<mrvn> netbsduser`: alternatives are for when the alternatives are interchangable. python3.x versions rarely are.
<netbsduser`> https://tech-pkg.netbsd.narkive.com/hH8VDLqS/installing-symlink-from-usr-pkg-bin-python-to-preferred-version looks like it was discussed in 2003 but no decision reached
<bslsk05> ​tech-pkg.netbsd.narkive.com: Installing symlink from /usr/pkg/bin/python to preferred version...
<heat> like, python may be controversial, sure. python3 is a nobrainer
<sortie> heat, what's your question?
<mrvn> The change from python to python2 was rather stupid. Just breaks existing systems for 0 gain.
<mjg> :]
<heat> sortie, not much, we were just discussing the BSDs not having a python3 symlink to python-$VERSION
<sortie> heat, yeah you just need a port of python 1
<heat> which is depressingly stupid
<sortie> heat, yeah you gotta have those
<sortie> No dash tho
<sortie> At least python3
<mrvn> he manes python-3.x, not python-3
<heat> sorry, I meant python3.VERSION
<heat> this is absolutely insane, how do you ever invoke python3 in a script that wasn't sedded to shit by pkgsrc?
<mrvn> #!/usr/local/bin/python3
<sortie> #!/usr/bin/env python3
<sortie> The portable magic invocation
<mrvn> with env you can't pass options
<sortie> mrvn, don't do that in shebang
<mrvn> (portably)
<sortie> Or in Sortix: #!python
<sortie> And all the options you could ever want
<sortie> Cus awesome.
<mrvn> sortie: your shebangs search PATH for relative paths?
<sortie> I laugh at your #! not searching PATH
<sortie> mrvn, same as shell rules, PATH search if no /
<mrvn> sortie: for LD_LIBRARY_PATH too?
<sortie> I don't have shared libraries
<sortie> But LD_LIBRARY_PATH has nothing to do with #!
<sortie> Or PATH
<mrvn> no, but it's the other thing in unix that doesn't search it's PATH
<mrvn> e.g. on dlopen
<mrvn> that whole RPATH mess
<sortie> Yeah
<kof123> +sortie on one hand i feel this is trivial...yet important...yet low hanging fruit for an enterprising osdever to provide something else/in addition
<kof123> sortie actually did something, sortie wins by default
<heat> sortie is the true enterprising osdever
<heat> gog, glibc is not linux centric
<gog> glibc is a lot tho
<heat> a lot of what?
<gog> it's a lot
<heat> glibc is a bit thicc yes, but you don't need to support it all
<gog> true
<heat> it's just like musl
<heat> although admittedly a bit larger
<heat> my first musl port supported, what, 3 or 4 syscalls? the basics to make it to int main(){}
<heat> my advice for porting $LIBC: just make it compile and link, and then make it work step-by-step
<heat> find out what syscalls are missing and implement those that are *actually* needed
<gog> goglibc
<heat> GNU/gog sounds sweet to me
<FireFly> copyleft gog huh
<heat> gnew slash gawg, or as i've recently taken to call it, gnew plus gawg
gildasio has quit [Ping timeout: 255 seconds]
<heat> gawg is not an operating system onto itself, but rather another free component of a fully functioning gnew system made useful by the gnew corelibs, shell utilities and vital system components comprising a full OS as defined by pawsix
gildasio has joined #osdev
<mrvn> In true AmigaOS fashion I have an exec.library
<sbalmos> mmm, is the gawg libraries prefixed with a.gog?
<sbalmos> and the file searcher is goggle?
<gog> pawsix
<gog> the catgirl operating specification
<gog> operating system
<gog> awwwperating system cause it's cute
<gog> yes
<gog> UwU
<sbalmos> system health reports your system is running purrfectly
<mjg> burp
<heat> no the file searcher is bing because bing best
<gog> no
<gog> you are banned from my operating system you will never log in every login prompt will have a captcha that everybody but heat can solve
<mjg> lemme guess
<mjg> "onyx sucks"
<mjg> does not go through his keyboard, does it
<heat> i agree
<mjg> try typing it man
<sbalmos> trying to log into my terminal will send a push authentication request to Elon's phone
<mjg> i got elon on speed dial
<mjg> anything you wanna ask just prod me
<heat> can you fix freebsd's shitty python3 scheme
<heat> thank you
<sbalmos> soon as he finds some people who know how to code
<heat> mjg is elon
wootehfoot has joined #osdev
<FireFly> sbalmos: oh but it's okay he hired geohot,
<heat> replies weren't loading properly because they switched that part to freebsd
<mjg> you fault for using python
<heat> devel@edk2.groups.io
<heat> tell them to stop writing the whole build system in python
<heat> thanx
<bslsk05> ​sirredbeard/Awesome-UNIX - All the UNIX and UNIX-Like: Linux, BSD, macOS, Illumos, 9front, and more. (91 forks/1234 stargazers/NOASSERTION)
<bslsk05> ​'Artosis meets his salt-equal' by Artosis Broodwar Clips (00:07:41)
<mjg> a middle-aged man acts as a teenager
<mjg> gg
heat has quit [Ping timeout: 256 seconds]
heat has joined #osdev
<heat> according to that thing, openvms is now unix-like, and so is fuchsia
<heat> also all the BSDs are AT&T derived
<heat> USL v BSDi be damned
<mjg> :]
<mrvn> isn't anything with a libc unix-like?
<gog> i'm unix-like
<mrvn> are you too on a mission from Glod?
<gog> nnnnn...yesss
<gog> sure
<remexre> I'm setting up ARMv8 page tables for identity mapping, and am getting a Prefetch Abort on the next instruction; is there a good way to debug this in QEMU?
<j`ey> not that I know of, without adding printfs / rebuilding qemu
<j`ey> but I suppose your page table is incorrect, the ESR should tell you which level is wrong
<sbalmos> Eric S Raymond can tell me what's wrong with my arm?
<j`ey> yup
Vercas62 has joined #osdev
Vercas6 has quit [Remote host closed the connection]
Vercas62 is now known as Vercas6
<bslsk05> ​github.com: arm/monitor: Add support for 'info tlb' command · patchew-project/qemu@0d06a04 · GitHub
<mrvn> single step it till it loads the table and then print the memory mapping
chartreuse has quit [Remote host closed the connection]
<remexre> mrvn: yeah, there's no command to do "print the whole memory mapping" other than just reading the bytes back; and they are what I expect
wootehfoot has quit [Read error: Connection reset by peer]
GeDaMo has quit [Quit: There is no spoon.]
Matt|home has joined #osdev
<geist> indeed. there's no 'info mem' or 'info tlb' on arm on qemu
<zid> and tbh, even on x86 it's lacking
<geist> can help here though if you have question
<zid> bochs is the tool with the good one
Vercas6 has quit [Remote host closed the connection]
Vercas6 has joined #osdev
bauen1 has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kaichiuchi> i am still playing with docker
<kaichiuchi> I find it cool somehow
Vercas6 has quit [Quit: Ping timeout (120 seconds)]
<zid> I find it to be a stupid solution that sidesteps solving the actual issue
Vercas6 has joined #osdev
<zid> and allows the degradation of every other software env to continue unabated
<zid> "I wrote all this shit in python and javascript and it breaks on anything but python 2.2.1.2r4-12 so now it's impossible to ship" "just ship the entire operating system with those packages manually installed" "okay"
<zid> correct solution: Shoot that person in the face
<geist> what are we talking about?
<geist> some python version issue?
<kaichiuchi> zid: I don't necessarily disagree
<geist> oh the docker thing, gotcha
<kaichiuchi> but for example, I can just send you a dockerfile with this: https://pastebin.com/n2sE4YPV
<bslsk05> ​pastebin.com: FROM --platform=linux/amd64 ubuntu:22.04RUN apt updateRUN apt install wget s - Pastebin.com
<kaichiuchi> and it Just Works
<kaichiuchi> I can give you a windows version and it'll just work
<kaichiuchi> at least with that pastebin, boom, I have an environment that I completely trust with the versions of shit that I care about
<zid> Yes but I am an idealist
<kaichiuchi> so am I
<kaichiuchi> do I think this is the MOST correct solution? nope
<zid> So in the ideal world, docker wouldn't have to exist, because it'd just work regardless
<zid> you'd send me the binary or source and that'd be just as good
<mjg> oooh
<kaichiuchi> yes, your source code may be fully C/C++ standard compliant, and it should just work on any compiler
<mjg> in a better world webdevs would not create docker images
<kaichiuchi> but how can I trust that your compiler is sane?
<zid> why would that be any care of yours
<CompanionCube> if we're doing the 'ship all the things', imo guix/nix solves the problem better than docker
<zid> how can you trust my cpu is sane?
<zid> it's reductive and stupid
<kaichiuchi> I care because I: a) want the user to have a good experience, and b) I don't want them to bitch to me in case something goes wrong if they're somehow stuck with g++ 4.2.0
<kaichiuchi> I'll give you something that is *guaranteed to work*
<kaichiuchi> again, keep in mind that I fully agree with you in that Docker isn't an ideal solution
<zid> >it's reductive and stupid
<zid> How can you trust my cpu?
<kaichiuchi> I can only go so far
<kaichiuchi> it's nice that I can toss a Dockerfile to you, and you run two commands and it works
<zid> might work*
<kaichiuchi> if it's a "might", then the Dockerfile is invalid
<kaichiuchi> or someone *reaaaaally* fucked up
<zid> nah I just clocked my ram to 2GHz this morning, good luck
<kaichiuchi> one thing I will say is environment shit is annoying in general
<kaichiuchi> it'd be nice if I could just grab your code, do `something build;` and it just works fucking _everywhere_
<zid> That's why we have distros, to tailor generic packages to the specific environment they've designed
<kaichiuchi> yes and look how that turned out
<zid> not everybody wants generic debian 4
<kaichiuchi> 28374923472934 distros
<kaichiuchi> take the one that can be trusted.
<zid> why would I want to 'trust' a distro
<kaichiuchi> well, for my use case anyway
<zid> trust them do to what?
<kaichiuchi> trust them not to completely break anything
<kaichiuchi> er, everything*
<kaichiuchi> man I come from a world where doing pacman -Syyu kills the whole system on reboot
<kaichiuchi> and then people hail linux distributions as better than sliced bread
<kaichiuchi> fuck that
<zid> so does deltree /y C:/windows/system32
<kaichiuchi> i rest my case.
<kaichiuchi> that didn't help your argument at all
<zid> what argument?
<zid> I wasn't arguing anything
<kaichiuchi> oh
<kaichiuchi> well, oops
<zid> I asked you what i needed to trust them to do
<zid> and you had a rant and I still didn't understand so I basically ignored it, then you said a funny command so I gave a different funny command
<zid> imma get a drink
<geist> heh takes a whie to tune into zids particular style of anarchy
<kaichiuchi> heh
<kaichiuchi> that's okay
<geist> am excite! i should get replacement RIFA caps any time now when UPS shows up
<geist> then i have a bunch of power supplies to fix
<kof123> "it'd be nice if I could just grab your code, do `something build;` and it just works fucking _everywhere_" yes, yes...i call this the tree of corpses who sought the grail of portability (java, c89, c99, c++, next, ...) <motions to tree> "they weren't good enough" </excalibur 1981, golden boy to percival IIRC>
<kof123> everyone wants that grail...
xenos1984 has quit [Read error: Connection reset by peer]
dude12312414 has joined #osdev
<geist> i was gonna point out BASIC, but then nope. in the basic programs in the magazines there was always the appendix part where you patched it for your particular micro
xenos1984 has joined #osdev
<kof123> c is there because people probably want threads nowadays and whatever else they expect in a standard library...leading to posix.....add .net ....
<kof123> eh, my definition of portable is "someone wrote the unportable parts"
<kof123> s/unportable/ {hardware|whatever else}-specific
<kof123> so i am not saying it is not a worthy goal, just many contenders
<kof123> or maybe there is 2 ways to achieve portability 1) write those parts 2) try to get people using the same hardware/etc.
crm is now known as orthoplex64
<mrvn> geist: aren't RIFAs just some rolled up paper? Didn't want to roll your own?
<remexre> ok finally got the `info tlb'-for-aarch64 patch working... and it confirms that I have a page table entry that's as I expect (identity-mapping the low 1GiB), but `x 0' in QEMU says "Cannot access memory" and I get a Prefetch Abort when continuing to execute
<j`ey> check the permissions?
<j`ey> whats the ESR?
<remexre> RW, no PXN; 0x21
<remexre> (for the high bits, I mean)
<j`ey> and what address is the pc? doesnt qemu exec around 0x4000000
<j`ey> (not the right number of 0s)
<remexre> yeah; PC is 0x402005ec when it faults
epony has quit [Quit: QUIT]
<remexre> I load at 0x40200000; I think I'm avoiding the devicetree? don't remember entirely
<j`ey> that's past the first 1GiB right?
<j`ey> (Im just confused by the `x 0`)
<remexre> ah wait I was off by a zero :/
<remexre> will try adding a second page; `x 0' being unhappy is still a mystery tho
Burgundy has quit [Ping timeout: 260 seconds]
<j`ey> and I assume 'x 0x40200000' doesnt work either?
<remexre> second page added; it does not
<remexre> and I'm pretty sure I'm not miscounting zeroes this time :P https://cdn.remexre.xyz/files/931b48aee8f09b63b7b21185e5988913c1062184.png
<j`ey> what's the full esr_el1 value? doesnt qemu print that
<remexre> yeah, it does; 0x86000009
<j`ey> you need to set bit 10
<j`ey> the AF bit
<j`ey> that fault is 'Access flag fault, level 1'
<j`ey> that's why I was asking for the ESR multiple times :P
<remexre> ahhh
<remexre> okay, looks like that makes it work (far enough to hit the next todo)
<remexre> thanks
<j`ey> np, good luck!
<remexre> is there some way to make the hardware maintain it (like how I thought x86_64 works?) without faulting?
<j`ey> for AF, I dont think so
<j`ey> (there's some other dirty bit stuff, that has some hardware features)