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
thinkpol has quit [Remote host closed the connection]
thinkpol has joined #osdev
gog has quit [Ping timeout: 268 seconds]
sonny has joined #osdev
gog has joined #osdev
remexre has quit [Remote host closed the connection]
remexre has joined #osdev
ghee has joined #osdev
sympt has quit [Ping timeout: 260 seconds]
sympt has joined #osdev
sonny has quit [Quit: Client closed]
ghee has quit [Quit: EOF]
matt__ has joined #osdev
frkzoid has quit [Ping timeout: 244 seconds]
SpikeHeron has quit [Quit: WeeChat 3.6]
frkzoid has joined #osdev
matt__ has quit [Ping timeout: 248 seconds]
[itchyjunk] has quit [Ping timeout: 268 seconds]
[itchyjunk] has joined #osdev
gog has quit [Ping timeout: 260 seconds]
SpikeHeron has joined #osdev
Clockfac1 has joined #osdev
<Clockfac1> no one makes standalone ELF executables for linux like they do for windows, is there any reason?
<Clockfac1> its pretty convinient
<Clockfac1> is linux less concerned with not breaking old binaries or something
<Clockfac1> oh
<Clockfac1> is it because there are 15000 gnu + linux distributions slightly different enough to break things?
<clever> Clockfac1: part of it, is that you cant really link opengl staticly
<clever> so any accel features are out the window
<clever> another part is that linux libraries are generally more backwards compatible, and usually work when upgraded
<klange> Several things:
<klange> - Windows exposes a very complete API as part of its standard runtime, so you can do a lot more with just a single binary. You want a GUI? You're not going to link in GTK or Qt, but win32 gets you one "for free".
<Clockfac1> ah, so windows is standardized
<klange> - No one really does that for Windows anymore, either, outside of small utilities; take a look at the Program Files directory for any given app and it'll be littered with DLLs.
<Clockfac1> while on linux you might not even know where your libraries are located?
<clever> Clockfac1: on linux, you usually rely on the ldconfig cache to know where libraries are located
<clever> and they just get installed into a standard location like /usr/lib/
<klange> It's not about knowing where they are, you don't need to know where libraries are in the normal case. You ask for "libc.so" and the linker finds it for you; DLLs work the same with some unremarkable differences in resolution ordering.
<clever> DLL loading is somewhat more lax, it can search in the working dir, and the dir the .exe is located in
<clever> this actually leads to some drive-by download exploits
<clever> basically, a website tosses a theme.dll into an iframe, and your browser drops it into the downloads folder
<clever> 5 months later, you grab a random installer, and the gui framework in the installer loads theme.dll automatically
<clever> *boom* your now a victim of malware
<Clockfac1> nice
<clever> even if you never touched the fishy file
<clever> a perfectly legit and safe installer, had a bug that runs less legit files automatically
<heat> I've never seen a completely statically linked windows executable
<heat> I'm honestly not sure if its possible
<heat> all executables link with a bunch of DLLs by default
<Clockfac1> maybe
<clever> windows itself, yeah ive never seen it either
<Clockfac1> if you only used kernel calls
<klange> I've seen them as demos, but poking the Windows syscall layer directly isn't kosher.
<Clockfac1> that arent documented or consistent
<Clockfac1> and shouldent be used
<Clockfac1> you could make it do stuff
<clever> Clockfac1: the syscall numbers yeah, arent stable
<clever> you must use kernel32.dll, because MS renumbers them all the time
<heat> and ntdll
<Clockfac1> ntdll.dll is stable enough, right?
<heat> its API? probably, but not the syscalls
<zid> winapi is almost entirely stable
<zid> across thousands of fucntions
<zid> it will even shim for older versions of windows
<clever> this also leads into a theory ive had before, back in the win 3.11 days, before the mmu was involved, i assume kernel.dll, WAS the kernel
<zid> sounds reasonable
<clever> and the .text of each loaded dll, was shared just by the lack of an mmu
<clever> and then with win95, kernel.dll became a wrapper, that just syscall'd into the kernel
<clever> to maintain the same API/ABI
<zid> even the 'syscall' interface is remarkably stable tbh
<klange> The real fact of the matter is that you _do_ see the closest equivalent of prebuilt Windows applications in the Linux world - they're called Ubuntu packages :)
<zid> ZwQueryProcessInformation etc have been there for decades unchanging
<clever> and kernel32.dll was the 32bit (not 16bit) version of the same wrappers
<zid> newer windows versions just add newer syscalls, and new winapi exposes them
<zid> or new flags
<Clockfac1> could you do kernel calls from user world with normal function calls
<heat> define "with normal function calls"
<klange> Jokes aside, "Linux is just a kernel" so you can't really meaningfully build standalone applications "for Linux", and even just adding "GNU" to doesn't get you far enough, either (though having a libc to target definitely gets you closer).
<Clockfac1> but by having some weird thing where the program can call/jump to the functions
<Clockfac1> and get into kernel mode
<Clockfac1> actually
<Clockfac1> nvm
<heat> yes
<heat> that's how system calls work
<Clockfac1> i know, but those use a proper method with interrupts or a processor instruction
<zid> this Clockfac1 guy is clever, inventing syscalls
<clever> Clockfac1: i think linux has an `int 0x3` api for syscalls, which you could still use, but vdso has long since replaced it
<heat> in another way? eh not really, I don't see how you'd do that
<heat> 0x80
<Clockfac1> yeah
<zid> There are arches where you literally just do a regular call
<heat> int 3 is #BP
<Clockfac1> i was wondering if there was something stupid you could do with virtual memory
<Clockfac1> for fun
<heat> well, sure
<zid> but it's to a sort of 'transition' page where user is allowed to jump into it and it transitions you to kernel
<clever> [root@amd-nixos:~]# grep vdso /proc/self/maps
<clever> 7fffc21d4000-7fffc21d6000 r-xp 00000000 00:00 0 [vdso]
<zid> you could do it on amd64 if you wanted I suppose via page faults :P
<clever> the vdso is a "dynamic" library that the kernel injects into every process
<zid> some 'syscall base' address and you just add a page for each syscall number, page fault handler turns it into a syscall :P
<heat> that would also be a PITA since you couldn't just call it
<clever> and it contains the code to initiate a syscall, using whatever opcode is best for this cpu
<clever> and it also has some "syscalls" that arent actually syscalls
<clever> gettimeofday() i believe is one
<heat> instead movabs $syscall_entry, %rax; call *(%rax)
<heat> or is it call *%rax?
<clever> the raw timer value, is mmap'd into every single process, and that function just reads it
<heat> something like that
<heat> <clever> and it contains the code to initiate a syscall, using whatever opcode is best for this cpu <-- only for IA32
<clever> ah, did x86-64 standardize that mess?
<heat> yes
<zid> amd64 standarized it twice!
<clever> good
<zid> sysenter and syscall!
<heat> no
<clever> lol
<heat> only syscall
<heat> sysenter is only present on intel CPUs
<clever> xen has the same thing, the hypercall page
<zid> I don't think anybody actually uses it thankfully, cus it's shit
<klange> The available interfaces from the vdso differ between architectures: https://man7.org/linux/man-pages/man7/vdso.7.html
<zid> syscall is also shit, but lessso
<bslsk05> ​man7.org: vdso(7) - Linux manual page
<zid> fred is fixing it though
<klange> Severals archs have syscall interfaces in the VDSO, but not all.
<klange> Time functions are the most commonly provided thing.
<klange> Some archs also have a return-from-signal call in the VDSO.
<heat> oh wow, wasn't expecting that
<heat> yeah I guess sigreturn is super doable in userspace
<klange> Anyway, the real reason that distributing "standalone binaries" isn't common in the Linux world is because: 1) most software is at least source-available, 2) for the longest time, most users were techincally inclined enough to bother building things themselves, and 3) viable package managers have been the backbone of every mainstream distribution since the beginning.
<clever> then at that point, you just generate a fake return addr, to return-from-signal, when jumping to the signal handler?
<clever> and when it tries to return, it winds up calling that func?
<clever> kind of like how rop exploit chains work
<heat> clever, see sa_restorer
<heat> libcs use it to run a trampoline that eventually sigreturns
<clever> sa_restorer is both a constant and a struct field, so its a bit hard to see where its used, and what it does
<bslsk05> ​github.com: Onyx/signal.cpp at master · heatd/Onyx · GitHub
<bslsk05> ​git.musl-libc.org: restore.s\x86_64\signal\src - musl - musl - an implementation of the standard library for Linux-based systems
<klange> I'm still using a magic faulting address... I did a big cleanup of my signal implementation, but cba to fix that right now.
<klange> I have bigger fish to fry, like a non-scalar pthread_t - initial patch looks good on the aarch64 VM, just spot checking that none of my x86-64 port library actually used my pthreads implementation...
[itchyjunk] has quit [Ping timeout: 255 seconds]
[itchyjunk] has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
sonny has joined #osdev
alpha2023 has quit [Ping timeout: 268 seconds]
alpha2023 has joined #osdev
heat has quit [Ping timeout: 260 seconds]
epony has quit [Remote host closed the connection]
dh` has quit [Read error: Connection reset by peer]
dh` has joined #osdev
frkzoid has quit [Ping timeout: 248 seconds]
sonny has quit [Quit: Client closed]
gxt_ has quit [Remote host closed the connection]
opal has quit [Remote host closed the connection]
opal has joined #osdev
gxt_ has joined #osdev
<Clockfac1> i can now count to 256 on my hands
<Clockfac1> i am more powerful than ever
<Clockfac1> i am 2.56 times more powerful than everyone else
<Clockfac1> wait no
<Clockfac1> 25.6
<Clockfac1> ok
<Clockfac1> maybe im not :(
<kazinsal> pro tip: use your thumbs for another two bits
andydude has joined #osdev
<Clockfac1> i use my thumb to keep track of which bit im on unfortunatly
<Clockfac1> each bit is a finger bone and fingernail
<zid> Literally just flexing or clenching each finger gets you 1024
<Clockfac1> optimization
andydude has quit [Quit: andydude]
<kazinsal> if you have really good control over your finger joints you can pull off ternary and get up to 59049 on your hands!
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
andydude has joined #osdev
<CompanionCube> clever: random scrollback: iirc each dataset is a big indexed array of objects which usually(?) resemble inodes. The index is reported as the inode number.
MiningMarsh has joined #osdev
<CompanionCube> so there's not really an 'inode tree', directories are just indirect key/vakue stores iirc
skipwich has quit [Ping timeout: 244 seconds]
saltd has quit [Read error: Connection reset by peer]
skipwich has joined #osdev
<moon-child> why stop at base 8?
<moon-child> err, why stop at base 3 when you could use base 8?
<moon-child> every finger has 3 joints; each joint can be either bent or unbent; so you have 2^3=8 states per finger
<mrvn> moon-child: lack of control of individual joins or fingers
<moon-child> that's why kazinsal said 'if you have really good control over your finger joints'
<moon-child> I mean, in principle, you can have your finger bent to an arbitrary position, that is \inf bits
<mrvn> CompanionCube: the big indexed array is a b-tree
<mrvn> moon-child: you only need one fingure even. But there is the plank constant.
<mrvn> practice wiggling your toes to get up to a million.
<Clockfac1> i sacraficed the amount of data i can process for my own convinience
<Clockfac1> it also fits with hex nicely
rorx has quit [Ping timeout: 268 seconds]
ThinkT510 has quit [Quit: WeeChat 3.6]
ThinkT510 has joined #osdev
<moon-child> plank constant is an implementation detail!
the_lanetly_052 has joined #osdev
<CompanionCube> mrvn: didn't think that was true, isn't according to https://zfsonlinux.topicbox.com/groups/zfs-discuss/T2dee6b9ec4221fa0/avl-tree-in-zfs
<bslsk05> ​zfsonlinux.topicbox.com: Topicbox
bxh7 has joined #osdev
andydude has quit [Quit: andydude]
biblio has joined #osdev
saltd has joined #osdev
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
PapaFrog has quit [Quit: ZNC 1.8.2+deb2 - https://znc.in]
PapaFrog has joined #osdev
alpha2023 has quit [Read error: Connection reset by peer]
alpha2023 has joined #osdev
GeDaMo has joined #osdev
smach has joined #osdev
rorx has joined #osdev
saltd has quit [Remote host closed the connection]
epony has joined #osdev
vin has quit [Read error: Connection reset by peer]
_saltd has joined #osdev
epony has quit [Read error: Connection reset by peer]
_saltd has quit [Ping timeout: 260 seconds]
saltd has joined #osdev
epony has joined #osdev
<clever> CompanionCube: but then how is that object array stored on disk? is that a tree?
<mrvn> CompanionCube: I'm not sure we are talking about the same thing. I was talking about the on disk structure.
gog has joined #osdev
diamondbond has joined #osdev
FreeFull has joined #osdev
nyah has joined #osdev
rorx has quit [Ping timeout: 252 seconds]
diamondbond has quit [Quit: Leaving]
gog has quit [Quit: byee]
rorx has joined #osdev
FreeFull has quit []
[itchyjunk] has joined #osdev
dude12312414 has joined #osdev
dude12312414 has quit [Client Quit]
ghee has joined #osdev
frkzoid has joined #osdev
ghee has quit [Ping timeout: 260 seconds]
frkzoid has quit [Ping timeout: 255 seconds]
matt__ has joined #osdev
zid has quit [Ping timeout: 248 seconds]
matt__ is now known as freakazoid333
xenos1984 has joined #osdev
ghee has joined #osdev
decartes has joined #osdev
ghee has quit [Ping timeout: 260 seconds]
FreeFull has joined #osdev
freakazoid333 has quit [Ping timeout: 255 seconds]
nyah has quit [Ping timeout: 268 seconds]
nyah has joined #osdev
zid has joined #osdev
<zid> sigh, PC was off when I woke up, lost an hour of my life trying to get it to boot again
gxt_ is now known as gxt
<GeDaMo> For why, Briggs, for why?
<kof123> some days/hours ago: "also comparison as well. see, because ref counts usually involving incrementing, decrementing, *and* comparing the results! the third one people forget about" "ah all you really need is add" "subtracting is like adding, but backwards" "all you need is kill" "and comparing is just subtracting, with bells on"
<kof123> "To Kronos (Cronus), Fumigation from Storax. Eternal father, mighty Titan, hear, great sire of gods and men, whom all revere; endued with various counsel, pure and strong, to whom increase and decrement belong." <-- just gonna throw that in there
<mjg> the funniest part about refcounting is when peolpe forget (or don't realize they need) fences
<mjg> and by fun here i mean fucked to debug
<zid> disregard fences, aquire x86
<mjg> acquire feces
<zid> maybe you can do that one alone
<mjg> already on it
heat has joined #osdev
<heat> mjg, my refc is all atomic
<heat> seq cst ordering
<CompanionCube> zid: lol, what broke?
<mjg> heat: that's a little overzealous
<mjg> heat: conceptually you can treat them like lock acquire/release
the_lanetly_052_ has joined #osdev
<mjg> or do you seq cst both sides of locking as well? :)
the_lanetly_052 has quit [Ping timeout: 268 seconds]
<heat> i'm just using the default std::atomic ordering
<heat> never really thought much about that
<Griwes> mjg: being clever about it yields faster code, yes, but also incredibly arcane bugs, as the list of bugs in various shared_ptr implementations shows
<heat> actually I'm looking at a refc that is ATOMIC_RELAXED oopsie
<mjg> Griwes: going for acq and release fences reespectively is not clever though :)
<Griwes> Just doing SC until it actually becomes the bottleneck is a reasonable way to approach the problem
<Griwes> Yeah it is, people are bad at reasoning about acquire and release semantics :p
<mjg> i agree, but if you are explicitly told that you can implmenet locking like that
<mjg> it is reasoned out for you, so to speka
<Griwes> heat: ouch :P
<Griwes> mjg: yeah but doing it correctly is _hard_ :P
decartes has quit [Quit: Connection closed for inactivity]
<mjg> Griwes: btw few years back i was reimplementing locking and while refactoring i copy-pasted an acq fence to unlock
<mjg> Griwes: instead of release
<mjg> Griwes: worked fucking great until i tried powerpc :)
<Griwes> Yeah I'm not surprised
<mjg> me neither, amd64 ordering is a blessing and a curse
<mjg> it was a copy-pasto, not intentional writing, but pretty funny in retrospect
<Griwes> I know more about atomics by the virtue of some things I nominally (and, in the past, actually) maintain at work, and there's still bits I wrote that I have to relearn every time I look at them
<Griwes> And a wizard who wrote some of it is now elsewhere so can't even ask them about some of the deeper magicks
<mjg> ye everyone who claims to really understand barriers is either lying or overestimatimng themselves
<mjg> that said, with something like reference counting, the difficulty is in knowing you need any of them to begin with
<mjg> not with choosing what they should be
<Griwes> Funnily enough my first phone screen question for $current_work was "how would you implement a cpu thread barrier"
<Griwes> And now it's going to chase me forever lol
<Griwes> I may be implementing and maintaining exactly what that question asked for in the next several months
<mjg> now playing a clever boy would be synchronising various changes with them by hand, so to speak
<mjg> [which is sometimes justified, but have fun debugging]
<mjg> oh, you want a clever trick, here it is
<mjg> you insert a *compiler* barrier instead of seq cst
<mjg> and when seq cst becomes relevant, do an IPI with it
<mjg> as in the ipi handler performs it
<Griwes> Another interview question I got for current job was "implement memcpy" and then discussion about possible optimizations
<Griwes> I now also sort of own a memcpy implenentatio
<Griwes> n at work
<mjg> what arch is this?
<mjg> something custom?
<Griwes> Oh, not a CPU one
<Griwes> I'm at nvidia
<Griwes> PTX is nice because since Volta it literally implements most of the C11/C++11 memory model at its virtual instructions level
<zid> "First, you find out the base address of the dma controler..."
<Griwes> (the aforementioned memcpy was cuda::memcpy_async, which I find to be a _really_ cool feature)
<mrvn> Griwes: is that making the GPU copy the stuff?
<Griwes> It is making a "side thread" copy the stuff (don't quote this explanation because its technically wrong)
<Griwes> A GPU thread can issue a memcpy that will happen outside of the main instruction stream of that thread
<mjg> now that you mention it, is there a youtube video or something' which sensibly talks about realities of gpu internals?
<mjg> i'm completely clueless about what's going on in there
<Griwes> Internals as in the electronic design of the thing or at the programming model level?
<mjg> say talking about a normal cpu i would mention caches, store buffer, branch prediction etc.
<mjg> so an equivalent
<Griwes> Hmm. I've never really watched any of our "inside X" talks on the various architectures, so I don't know how deep they go, but that would probably be a good start?
<bslsk05> ​developer.nvidia.com: GTC 2020: Inside the NVIDIA Ampere Architecture | NVIDIA Developer
<mjg> > After clicking “Watch Now” you will be prompted to login or join.
<Griwes> Some of us are fighting to get theese onto YouTube, but estaff has [redacted] ideas on the issue
<GeDaMo> I did a CUDA course a while back, all I remember is multiple (vector) cores each with their own local memory, you manually transfer data to/from GPU global memory
saltd has quit [Remote host closed the connection]
<Griwes> Yeah that's a quite dated summary of what CUDA can do
<GeDaMo> ... the course may have been ten years ago :|
<zid> My assumption was that cuda let you use the cores, managed by a guy doing thread control etc, and that's also what the gpu was doing when it ran shaders, compiling them to 'cuda programs', ignoring 400 layers of details
<Griwes> That's accurate if you're looking at it from 10000ft
<zid> who needs more detail than that
<zid> nvidia losers, that's who, and who needs those guys
<Griwes> lol
saltd has joined #osdev
<mjg> fwiw the one bit i found interesting about nvidia is that they (at least used to) maintain a solaris driver
<zid> nvidia has a LOT of customers
<saltd> and good accelerator engines
* saltd in search of gpu/chip accelerated deep lerning for python
<zid> Griwes: I need you to locate me a secret prototype 2xxx or 3xxx with a ramdac, and smuggle it out of nvidia HQ in a daring heist
<mjg> i'll give you my custom nft if you do
<heat> mjg, they also maintain a freebsd driver don't they?
<heat> all worthless operating systems /s
<mjg> while you are talking shit about freebsd i'm using DOORS on solaris
biblio has quit [Quit: Leaving]
<zid> Is that why you take so long to reply, pure streams based networking
<mjg> yes
<GeDaMo> Did you cross the streams? :|
<heat> mjg is also running on 8 threads
<heat> solaris only scales to 2 :|
<mjg> funny you say that
<mjg> get yourself a 2 thread vm with solaris and run lockstat -C sleep 10
<mjg> crazy
epony has quit [Remote host closed the connection]
epony has joined #osdev
heat has quit [Ping timeout: 260 seconds]
heat has joined #osdev
GeDaMo has quit [Quit: Physics -> Chemistry -> Biology -> Intelligence -> ???]
frkazoid333 has joined #osdev
heat has quit [Read error: Connection reset by peer]
heat has joined #osdev
frkazoid333 has quit [Ping timeout: 255 seconds]
<zid> heat: happen to know if the external ME uses the 3.3V rail to run itself
<heat> what's the ME?
<heat> management engine?
<zid> ye
<heat> idfk
<heat> is that even in public chipset docs?
<zid> I'm wondering if my fucked up issues might be the ME just.. not running right, cus my 3.3V rail is fucked, my 3.3V rail *was* dying
<zid> idk but you were the most likely candidate to ask
<zid> I got some new post codes today, stuck at initializing CSM agent and shit
<zid> started making me suspect the "weird efi issues, bios code seems to work fine" might be the ME crashing
<heat> but the ME works in CSM and in EFI
<heat> in fact, CSM is still EFI
<zid> exactly?
<zid> if ME no worky, I'd expect weird post codes like "CSM agent" stuff, and the efi splash screen to be all fucked up etc
<zid> If I can crash at the exact point it trains the dram, I get the legacy slash screen instead of the graphical efi one, telling me OC failed and I should hit F1, and then everything works fine
<zid> if I don't, I get fucked up behaviors and unreliable post
<zid> plus I have past evidence that my 3.3V rail might be fucked, which sounds perfect to run those little 3.3V arm cotex chips on or whatever the ME happens to be..
<heat> you mean the 486
<heat> no joke
<heat> but anyway, I don't get your point - CSM is literally an EFI module
<heat> there's no "legacy BIOS" anywhere, it's all EFI
<zid> My bios is genuinely split right in half
<zid> there's a special upgrade proceedure you have to do to flip it to 'modern' efi
<zid> and add windows 8 support etc
<heat> huh
<heat> weird
<zid> I think the 'doesn't expect efi to exist or rely on it' code still exists and works fine
<zid> if I can trick it into running it
<heat> it might just be more compact
<heat> such that you don't hit your possible flash issues
<heat> that 3.3V rail thing is probably one of those hw details that are really under NDA
<heat> also, platforms back then were completely closed so...
<zid> ah well, I think a friend says he has a spare psu he can just give me
<zid> so I might as well try a new psu first
<zid> then a new flash chip, then kill myself
<heat> fake your death and buy a new xeon + mobo
<heat> easier than killing yourself
<zid> how does being dead help
<heat> fake it, collect your insurance money, splash it on the xeon
<zid> I am not insuranced
<zid> do you want to take some out
<heat> get one suspiciously before your tragic death
<klys_> re: how does being dead help; the moral of this story is curiosity kills. death is a subject of philosophical inquiry and moral engagements. the five branches of philosophy are ethics, metaphysics, epistemology, politics, and aesthetics. morality is charity and virtue. without that you have an ethical question which deserves your scholarship.
<heat> cheers mate
<klys_> how are you?
<heat> im fine hbu
<klys_> am well, just got back from work and had lunch
<heat> that's the spirit
<heat> you work weekends?
<klys_> yeah all except friday and sunday
<heat> that's quirky but not too bad
<klys_> part time at 28 hour weeks, off at 2pm
<zid> gotta leave lots of time for messing with groupies
<klys_> I filed for sole proprietorship yesterday under my name
<klys_> type of business, bare pcb production
<klys_> this business license should only cost me anything after signing up for authorize.net and paymentcloud
<zid> I think I still run a business? not sure
<zid> idk if you have to actually *do* anything to keep them active, but I started one
<klys_> yeah do you take donations?
<zid> I take donations
<klys_> paypal?
<zid> definitely, I need to buy an spi chip off ebay
<klys_> ah yes, I am just curious, however
<zid> nope, give 20 shekels
<zid> or heat gets it
<klys_> null pointer dereference at 15:47:51
* zid pulls a stick with some poo on the end out of his coat
<heat> i get what
<zid> (I actually checked, 20 shekels is correct)
<zid> (about $6)
<knusbaum> Hey, everyone. Having trouble getting GDB to recognize an executable from my handmade linker. file and readelf both report correctly and the executable runs. Just GDB fails with error "/myexe: not in executable format: bad value"
<knusbaum> I looked at the readelf output but didn't see anything obviously wrong. All output here: https://gist.github.com/knusbaum/43513d716657ae9ea8cf70814f21890b
<bslsk05> ​gist.github.com: file · GitHub
<zid> 'bad value' is such a wonderful error message
<klys_> sounds like something to grep gdb sources for
<klys_> I'm guessing you haven't compiled your own gdb yet tho
<zid> yea I think you're just going to have to build gdb with more printfs
<heat> yeah your best bet is to printf-debug gdb
<knusbaum> lol.
<knusbaum> never expected to debug GDB.
<knusbaum> And yeah, what a freaking terrible error message, "bad value"
<zid> gbd's kinda held together with string and hope in my experience
<heat> have you tried lldb?
<knusbaum> I tried lldb in the hopes the error message would be more helpful.
<heat> (I'm assuming your executable runs)
<knusbaum> But lldb has no problem with the binary.
<knusbaum> Hmm, actually lldb loads fine, but when I try and run I get "error: process launch failed: 'A' packet returned an error: 8"
<zid> does it.. run normally?
<zid> ./myting.dollar.cash.money.exe
<klys_> knusbaum, ...and the executable runs?
<zid> If it doesn't run my first suggestion would just be to set the load address higher than 30000
<zid> below 1/2M might just be baninated
<knusbaum> zid, It does run normally, yeah.
<knusbaum> It's a super basic "hello world" program, but it runs.
<knusbaum> and exits normally.
<zid> time to add them printfs then
<zid> oh good, my vm still boots, I was worried it wouldn't, I think vt-d defaults to off
<zid> and I can't change the settings rn..
<zid> I have gdb 11.2 if you wanna pass the binary over
<heat> I have 12.1 as I use arch linux
<zid> I have 12.1 but only for mips :P
<zid> I'd have to unmask 12 for amd64
<zid> maaan, my benchmark results are so bad without XMP and stuff :(
<zid> 5GB/s memmove
<knusbaum> I'm surprised there's not a well-known elf-format analysis tool. I've been searching and find mostly articles about reverse engineering and hand-repairing the headers, but not actually seeing what's wrong with them.
<zid> yea PE has the same issue, PE explorer existed but doesn't support 64bit
<zid> people just seemingly don't give a shit
<zid> when binary btw?
<heat> it's top secret
<zid> top "Hello world" secret
<klange> what do you mean by "wrong with them", as in you're looking at corrupt elfs?
<zid> It's mroe that debuggers are very picky and that the linux kernel is the complete opposite
<zid> than it actually being corrupt, probably
<heat> yeah
<heat> as with anything UNIX, there are no tests for this stuff
<zid> That 54 byte 'entire elf' project being the prime evidence for the kernel not giving a flying fuck
<klange> What's weird about the initial problem here is gdb and readelf should be using the exact same backend... they're the _same git repository_, even...
<klange> (cursed be the "binutils-gdb" git repo)
<zid> blessed be his name
<heat> yeah they both use bfd right?
<knusbaum> It's just a "hello world" program generated by my assembler and linker. Obviously *something* is wrong with my ELF, but I can't tell what.
<zid> I could, if you post the binary
<knusbaum> Sure Hang on
<zid> hoorah, third try lucky
<zid> 11 gives a nicer error message at least
<zid> not in executable format: file format not recognized
<knusbaum> haha.
<zid> dang, this repo is big, maybe I should have shallow fetched it
<knusbaum> I figured it out...
<knusbaum> Very dumb. The last element in my .shstrtab was not null-terminated.
<klange> f
<zid> neat
<zid> I was half way through building gdb master still cus my PC is all slow now
<knusbaum> Jeez.
<geist> zid: pedal faster
<knusbaum> It's interesting that since it's at the end of the section, lldb and other tools don't have any issue with it.
<zid> I've got no XMP or turbo, pls be gentle geist
<geist> oh you dont have a turbo button to push?
<zid> I mean.. I do, but I doubt it works
<zid> and if I press it and it crashes I'm in a lot of trouble
<zid> (My mobo literally has a turbo button)
<zid> I think it's designed so that you boot windows in 'moderate' settings, then once your fan controller software etc is all loaded, you press the turbo button
<zid> to switch to the severe ones
gog has joined #osdev
<heat> try it
elastic_dog has quit [Ping timeout: 244 seconds]
<zid> you just want to be rid of me for an hour until I can get it to boot cleanly again
<heat> i don't think you'll be able to boot cleanly
<zid> You want to be rid of me for good then? harsh
<heat> yes
<zid> I've kept what a horrible person you are all to myself and everything
<zid> I regret my past actions
<zid> gog: Did you know that heat is a big poopieface meanie?
<heat> 💩😃
<zid> He did that on purpose because he knows I use fixedsys with no emoji even
elastic_dog has joined #osdev
<gog> zid: heat: stop fighting boys
<zid> I'm not fighting a boy I am fighting a poopieface meanie
* klange gives gog a fishy
* gog chomp fishy
opal has quit [Remote host closed the connection]
opal has joined #osdev
<knusbaum> We should all nurture our inner big poopieface meanie.
<zid> heat gave his miraclegrow
<zid> I know he was in a terrible accident involving that industrial shredder and his face, but please stop sending your thoughts and prayers, he's growing too strong we can barely contain him
<gog> i for one welcome our new portuguese overlords
<heat> helo
<heat> i am boss
<heat> do work for me
<zid> wages pls
<heat> negative
<zid> reverse internship!?
<heat> how about i dont eat ur family
<zid> that's generous of you, I haven't even done any work yet
<zid> heat are you actually a portugal or did you move there from a real country
<heat> i am actually a portugal
<heat> being a citizen of a fake country is hard :(
<gog> my friend luisa is a portugal
<zid> well that doesn't help, he needs to marry someone from a real country
<gog> can't be me, i'm already married to somebody from a fake country
<zid> btw is it allowed to start a tinder profile and say you have to have epicanthic folds, or is that racialist
<gog> i think that's a little uh
<gog> i wouldn't do that
<zid> I think it's a no-go too
<zid> I should make a dating app for fetish matching or something
<gog> that exists already
<zid> you just click a bunch of checkboxes for if you wanna be dommed or whatever or not
<gog> well sort of
<gog> i think it's more a discussion board than a dating site?
<zid> yea I bet forums/websites exist 100%
<zid> else it'd be hard to find anyone at all to pee on you while wearing a mr blobby outfit
<gog> zid this is #osdev
<zid> oh right
<zid> pee on you while wearing a RMS outfit
<gog> lmao
* saltd prays gog with a catholic priest
<zid> Mine got eaten by the washing machine sadly :'(
<saltd> :(
<gog> :(
<gog> i prefer my linus torvalds mask
<zid> That's not fetlife that's just normal