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
<the_oz> no it definitely defaults to -j 1
<heat_> hm?
<the_oz> 175s with -j 24 and clean step first to as well.
<heat_> i mean yeah
<heat_> ofc it defaults to -j1
<the_oz> it just likes telling you how many cores you COULD have saves time with
<heat_> KERNFAST=1 was to avoid rebuilding the whole thing
<the_oz> "ofc it etc" when I develop my own theme park
<the_oz> with blackjack and hookers
Ermine is now known as systemdfanboy
<the_oz> :|
<the_oz> >it's only a halloween costume. Must be.
<systemdfanboy> yes
<systemdfanboy> trick or treat
<the_oz> you get nothing!
<the_oz> you lose!
<the_oz> good DAY sir!
<systemdfanboy> you get systemd on your freebsd. enjoy
<the_oz> AHHHHHHHHH
eddof13 has quit [Quit: eddof13]
eddof13 has joined #osdev
systemdfanboy is now known as pessimal
heat_ has quit [Ping timeout: 252 seconds]
Dead_Bush_Sanpai has joined #osdev
steelswords94 has quit [Quit: Ping timeout (120 seconds)]
steelswords94 has joined #osdev
rb has quit [Remote host closed the connection]
rb has joined #osdev
dormito has quit [Ping timeout: 244 seconds]
alice has quit [Ping timeout: 276 seconds]
dormito has joined #osdev
alice has joined #osdev
goliath has quit [Quit: SIGSEGV]
eddof13 has quit [Quit: eddof13]
Arthuria has joined #osdev
archa has quit [Ping timeout: 276 seconds]
youcai has quit [Quit: No Ping reply in 180 seconds.]
youcai has joined #osdev
_nater_ has quit [Read error: Connection reset by peer]
FreeFull has quit [Ping timeout: 252 seconds]
FreeFull has joined #osdev
karenw_ has joined #osdev
karenw has quit [Ping timeout: 272 seconds]
Fingel has quit [Read error: Connection reset by peer]
gog has quit [Quit: byee]
vai_ has joined #osdev
karenw_ has quit [Ping timeout: 272 seconds]
frkzoid has joined #osdev
the_oz has quit [Remote host closed the connection]
the_oz has joined #osdev
aethlas has joined #osdev
aethlas_ has quit [Ping timeout: 252 seconds]
Arthuria has quit [Ping timeout: 260 seconds]
karenw has joined #osdev
vai_ has quit [Ping timeout: 265 seconds]
griddle has joined #osdev
griddle has left #osdev [#osdev]
benlyn has quit [Remote host closed the connection]
griddle has joined #osdev
griddle has quit [Client Quit]
griddle has joined #osdev
kof673 has joined #osdev
vdamewood has joined #osdev
vdamewood is now known as vampiredamewood
vai_ has joined #osdev
griddle has quit [Quit: griddle]
vai has quit [Read error: Connection reset by peer]
kaidezee has joined #osdev
jedesa has quit [Remote host closed the connection]
craigo has joined #osdev
<kaidezee> Hello everyone. I don't know if this is the right place to ask, but here's the thing: I wanted to look at (disassembled) code of UEFI implementation on my machine. I got dumps of flash (maybe it's nand? I don't know) from my motherboard via internal programmer and analyzed them with UEFITool. But when I tried to look at IME kernel, I figured that it was probably compressed, since there were no
<kaidezee> actual instructions when I opened up ghidra. UEFITool confirmed that theory by showing attribure "Huffman compressed: yes" under "ME/Boot partition/Bring Up/kernel" node (which is the one I want to work with). So my question is: is there a decompression utility that can help me with that?
karenw has quit [Quit: Konversation terminated!]
<zid`> You should first run binwalk over it
<kaidezee> Let me google what that is
<kaidezee> Thanks I'll have a look
netbsduser has joined #osdev
pebble has joined #osdev
op has joined #osdev
pebble has quit [Quit: KVIrc 5.2.4 Quasar http://www.kvirc.net/]
<zid`> so.. was binwalk any use?
<zid`> it should tell you a bunch of info and is capable of dumping all the files out of a bios update in a nice way
bauen1 has quit [Ping timeout: 276 seconds]
<kaidezee> zid`: Not really. Binwalk didn't find any files in ME.
<kaidezee> Or coundn't extract them perhaps
Left_Turn has joined #osdev
<kaidezee> Binwalk only found one... err "thing" and it has description that states "JBOOT STAG header" and some other data that I have no idea how to use (timestamp, image id, header checksum, etc.)
MiningMarsh has quit [Read error: Connection reset by peer]
<zid`> so what is the file you have, an ME firmware blob?
<kaidezee> Yes
MiningMarsh has joined #osdev
<kaidezee> I actually have the entire rom, but want to work on ME
<zid`> github has a bunch of random
<bslsk05> ​platomav/MEAnalyzer - Intel Engine & Graphics Firmware Analysis Tool (206 forks/1065 stargazers/NOASSERTION)
<zid`> tools like this
<zid`> never used any of them though
<zid`> is this from a bios for a certain mobo?
<kaidezee> yes
<zid`> go on then
<kaidezee> I tried MEAnalyzer, but it just prints a bunch of info about the image. Not so useful for patching
<zid`> what motherboard?
<kaidezee> MSI Z390 Gaming Plus
<zid`> patching ME? I thought all that shit was heavily signed
<kaidezee> I guess not
<kaidezee> I mean, worth a try right?
<kaidezee> The most I did was enable the HAP byte
<bslsk05> ​gist.github.com: gist:e0cb277517a0879b312b651a2860ba4e · GitHub
<zid`> is what you get if you run it over the actual bios file
<kaidezee> Very close
<kaidezee> let me diff it
<kaidezee> It appears they are not
<zid`> how annoying, the files seem byte swapped
<zid`> or they have a length header? lemme chop off 4 bytes
<zid`> yea, 4 byte header on them all, okay fair enough
<zid`> so the lzma data at 0x3901D4 in my E77B1IMS.1F0 ends up being PE32+ executable (DLL) (EFI boot service driver) x86-64, for MS Windows, 5 sections
eau has joined #osdev
<zid`> (and appears to be related to training ddr4)
<zid`> do you know where the ME blob is?
<kaidezee> No, I don't think I do. But this is what binwalk gives me when I run it on ME blob https://gist.github.com/ka1dezee/aad50bfc6c89be9f2226b4d0334bbfd1
<bslsk05> ​gist.github.com: gist:aad50bfc6c89be9f2226b4d0334bbfd1 · GitHub
Turn_Left has joined #osdev
<kaidezee> There's a similar line when I run catwalk on bios: 3683888 0x383630 JBOOT STAG header, image id: 12, timestamp 0x1731BF96, image size: 1135794469 bytes, image JBOOT checksum: 0x8332, header JBOOT checksum: 0xC9AE
<kaidezee> binwalk
<kaidezee> BINWALK
<zid`> so we subtract 2440952
Left_Turn has quit [Ping timeout: 265 seconds]
<kaidezee> What do you mean subtract?
<zid`> what version of the bios did you grab btw
<kaidezee> I have no idea
pabs3 has quit [Ping timeout: 244 seconds]
<zid`> I went with 7B51v1F because it was the latest
Left_Turn has joined #osdev
<kaidezee> I just read internal flash
<zid`> oh so whatever was flashed to your board then
<kaidezee> yes
<kaidezee> Alsa
<kaidezee> oops
<kaidezee> Also I swiched the hap bit on that image i dumped
<nikolar> i think you can see the version your motherboard is running if you just boot it u
<nikolar> *up
<kaidezee> yes, but then i will have to leave this chat for awhile
<nikolar> ah
<zid`> # strings ../../E7B51IMS.1F0 | grep 7B51
<zid`> uP$MSESGN$E7B51IMS.1F0 07/08/2024
<zid`> $MS1E7B51IMS1F0
<zid`> that might work to find out your version
Turn_Left has quit [Ping timeout: 272 seconds]
<bslsk05> ​gist.github.com: gist:5ea4b07f176104e52d1398ea5f10caa6 · GitHub
<zid`> uP$MSESGN$E7B51IMS.1E0 10/20/2022
<kaidezee> There is abit more info
<kaidezee> * there
<nikolar> looks like there's your version
<kaidezee> Yes, which one though?
<nikolar> btw if you plan to mess with the bios, i suggest you get a different computer ready lol
<kaidezee> uP$MSESGN$E7B51IMS.1E0 10/20/2022 seems like it
<zid`> I already have it and binwalked it :p
pabs3 has joined #osdev
<nikolar> lol i was about to type that zid` can just download it now
<zid`> more or less matches, just missing the little esp header
<zid`> because it was part of the flashing process presumably
GeDaMo has joined #osdev
<zid`> I need to install whatever tool it is that decompresses a YAFFS
<zid`> because otherwise binwalk chokes there :(
<kaidezee> yaffshiv?
<zid`> yea that
<zid`> I have yaffs2utils but not that, apparently, oh well
<zid`> what's the first few bytes of your supposed ME image?
<kaidezee> extracted YAFFS, folder seems to be empty?
<zid`> I wanna try find them in this image to resync them
<kaidezee> Where do I get that from?
<zid`> a.. hex editor?
<kaidezee> Oh
<kaidezee> firs column of ME image, if that's what you mean.. https://gist.github.com/ka1dezee/dd5f89b36b6e0addd7899a7391068386
<bslsk05> ​gist.github.com: gist:dd5f89b36b6e0addd7899a7391068386 · GitHub
<zid`> yea I don't believe your tool for a second there
<zid`> if that's what it thinks the ME image starts with
<kaidezee> i used hexdump
<zid`> yes
<kaidezee> lemme just upload full output
<zid`> although if it is huffmanned then maybe?
<bslsk05> ​gist.github.com: gist:aed9c4e3140589b81358f1181d510e2b · GitHub
<zid`> ah I found your thing, you helpfully used not -C so it was all byteswapped
<zid`> exactly 0x3000 in the file
<kaidezee> sorry
<kaidezee> I'm kind of a n00b in this stuff, as you can see
<sortie> It's my last day at the big G
<sortie> Not that I have done any work in the past 6 months
<zid`> grr now I need python2
<zid`> who has python2
<kaidezee> i don't
* sortie raises hand and takes it down again
<zid`> I wonder if I can just.. change a 2 to a 3 and have it work
<sortie> 2to3
<zid`> oh, I have that, thanks sortie
<sortie> zid`: You'd actually be surprised how often simply running it on python3 instead actually works
<sortie> And then 2to3 if that fails or you can't just spot a trivial replacement of some import
<zid`> # ./fixed.py ../ME.bin
<zid`> ./fixed.py: line 1: syntax error near unexpected token `('
<zid`> :(
<zid`> oh it spat out a diff!
<kaidezee> what is it supposed to do??
<sortie> I'm sure there's a mode to just rewrite the input file
<zid`> yea let's just use -w
<zid`> heh it fixes up some stuff, but not the shebang
<zid`> sadly it doesn't work
<zid`> The tools I have either don't run, or stop working after ME 10
<zid`> which is 2015
gildasio has quit [Remote host closed the connection]
<zid`> right bored of this game if I am going to have to learn python to play it, sorry
gildasio has joined #osdev
<nikolar> sortie: always nice to get payed for no work :P
<sortie> nikolar: Nothing like a capitalism opt out
<nikolar> how did that happen anyway
<sortie> They decided they couldn't afford me anymore so they outsourced my job to mexico city and last I heard my replacements aren't even hired yet
X-Scale has joined #osdev
<zid`> and yet, sortie didn't buy me a pony for my birthday last week :(
<nikolar> i meant the not working for 6 months part
<nikolar> though that's unfortunate to hear
<kof673> 1) capital got replaced with credit, just a q who can issue it and who is on the hook 2) i got python2 surely, wasn't following though
<sortie> nikolar: It's a perfect combination of actual labors laws and corporations using money to pretend it's America where it's at-will employment
<zid`> hehe
<nikolar> lol
<zid`> elon had that same realization in ireland
<zid`> when he fired that disabled guy
<sortie> They wanted me gone one day so they just paid me a lot and told me I no longer have to do anything
<nikolar> so they fired you but kept paying you for compliance
<nikolar> nice
<sortie> I mean it's all above board and I have no issues with them whatsoever
<sortie> I was laid off, not fired
<nikolar> right, sorry
<sortie> I wasn't the only one, it was a whole bunch of people :(
<bslsk05> ​www.roscommonherald.ie: Musk's X ordered to pay Irish worker record €550,000 unfair dismissal award - Homepage - Roscommon Herald
<nikolar> :(
<nikolar> well i hope you enjoyed your 6 months of free money
<kof673> > America where it's at-will employment in theory, but that is a mirage, because you cannot get non "on the hook" id nowadays lol
<sortie> I was entitled to 5 months of full pay but if I signed some reasonable papers I got another month plus a bonus equivalent to 6 months pay
<sortie> So with 12 months pay to do nothing I'm laughing all the way to the bank
<kof673> "human capital" is what is used
<zid`> sortie: And yet, 0 ponies
<nikolar> What was in the "reasonable papers"
<zid`> "promise not to go postal"
<kof673> this is why i say also don't make an osdev u.s. organization...that will be on the hook
<sortie> nikolar: Basically they spelled out what the law already said, clarified a few gray zones (such as whether I am allowed to be at the office, since contractually I am still an employee), released me from some requirements, various things, no nda or nothing of that sort, and then gave me another month of employment and 6 months pay on top extra
<nikolar> So basically some basic paperwork to clarify stuff
<zid`> I liked the old article I read about early apple, where they.. mislaid some employees
<nikolar> And you got 6 extra months
<zid`> kept paying them but didn't give them any work
<zid`> so they just came to work and started a studio or something
<sortie> As much as I think they fucked up by laying me off, I very much appreciate the process and it was all very above board. My VP literally took the time to tell me personally and explained to me that it was so they could save money by outsourcing to India and Mexico City. I mean, at least they're being honest.
<zid`> They need the 6 months to install all the "SORTIE >" signs in the corridors
<zid`> to get rid of you
<sortie> I would very much appreciate such a sign
<sortie> I'll hang such a sortie sign over my next desk
<sortie> I bet the facilities will be read mad if it has fire code implications
<zid`> 129 CAD, pretty cheap
<bslsk05> ​www.sanbec.ca: SORTIE sign fixture – Sanbec
<zid`> It lights up!
<sortie> Choisissez votre langue / Choose your language: [FR] [EN] ← I'd like the french sign plz
<zid`> I can't find any NIKOLAR signs unfortunately
<zid`> only sortie is important enough for people to make him signs with his name on
<kof673> > at-will or, there is the other side of that equation is what i mean.......anyways ......you have to be allowed to quit
bauen1 has joined #osdev
<sortie> They have sortie signs in the vatican
<sortie> After I helped them with their Holy C migration
<zid`> Oh sorry I didn't know you were a religious figure, should I have been calling you Your Eminence?
<zid`> Where's my pony, Your Eminence!?
<chiselfuse> 48-bit canonical addressing applies to the virtual address. if the physical range is 52-bits, does it apply there too?
<zid`> physical addresses are not signed, no
<chiselfuse> why do you call canonical addresses signed? do you interpret the extension of bits as 2's complement's signedness?
<zid`> You just.. sign extend them
<zid`> from 48bit to 64bit
<zid`> to make them canonical
<zid`> It's very common you will see that the address range is -128TB to +128TB etc
<zid`> rather than high and low, kernel lives in negative addresses, userspace positive
<chiselfuse> i never saw that, can you give me a url or something to a text that refers to to them this way (-128TB +128TB)?
<bslsk05> ​forum.osdev.org: 64-Bit Higher Half Kernel - OSDev.org
<bslsk05> ​read.seas.harvard.edu: Memory layout – CS 161 2018
kaidezee has quit [Quit: WeeChat 4.4.2]
<zid`> You will see lots of references to putting the kernel at -2GB also
<zid`> because it's a lot easier to type than 0xFFFFFFFF80000000 :p
<nikolar> Lol
X-Scale has quit [Ping timeout: 256 seconds]
<chiselfuse> is the PhysAddr of segments in ELF for when paging is disabled (real mode) or what?
\Test_User has quit [Quit: \Test_User]
<zid`> I think it's so that you could technically control where the loader both puts it into physical memory, and then maps it into logical
<zid`> but linux and windows etc don't actually support you doing the former
<zid`> but maybe some embedded systems do
<kof673> just answering the q > Equuleus the Little Horse is a diminutive constellation that lies south of the Summer Triangle. i would guess a pale horse, then red trojans eventually pop out perhaps lol
<chiselfuse> zid`: logical is translated to virtual through segmentation, and virtual is then mapped through physical through paging. you're saying that it would allow me to specify where to put it on physical memory after which i'd be able to read it through however it was mapped back to virtual and logical?
<zid`> yes
<bslsk05> ​refspecs.linuxfoundation.org <no title>
<chiselfuse> i can't find this, where do i find the x86 one
vampiredamewood has quit [Quit: Life beckons]
emntn has quit [Quit: WeeChat 4.4.2]
bauen1 has quit [Ping timeout: 252 seconds]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 272 seconds]
\Test_User has joined #osdev
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 244 seconds]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
\Test_User has quit [Quit: \Test_User]
edr has joined #osdev
bauen1 has joined #osdev
\Test_User has joined #osdev
gildasio has quit [Ping timeout: 260 seconds]
gildasio has joined #osdev
levitating has joined #osdev
ramenu has quit [Quit: ZNC 1.8.2+deb3.1+deb12u1 - https://znc.in]
ramenu has joined #osdev
heat_ has joined #osdev
Turn_Left has joined #osdev
goliath has joined #osdev
Left_Turn has quit [Ping timeout: 244 seconds]
Nixkernal has joined #osdev
levitating has quit [Ping timeout: 265 seconds]
levitating has joined #osdev
levitating has quit [Ping timeout: 260 seconds]
hwpplayer1 has joined #osdev
eddof13 has joined #osdev
eddof13 has quit [Client Quit]
<sortie> https://maxsi.org/resume.pdf ← Updated my resume'
<pessimal> hi
Marsh has joined #osdev
MiningMarsh has quit [Ping timeout: 265 seconds]
Marsh is now known as MiningMarsh
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 272 seconds]
<heat_> pessimal, musl malloc
<heat_> sortie, i still don't really like the bullet points in your google section
<heat_> namely that they don't nest
<sortie> heat_: It did get a bit wordy yeah.
<heat_> i mean yes it's a little wordy, but that's not my nit
<heat_> https://i.imgur.com/GdmZjms.png i'd expect the bullet points to nest there
<bslsk05> ​i.imgur.com <no title>
<sortie> You ever have one of those days where your resume ends up on imgur
<heat_> lol
<heat_> you're making me want to rewrite my resume, but inside my own OS
<sortie> I was gonna do that but porting latex seemed like a rabbit hole
<heat_> it might be more palatable than it seems from the arch package thingy i linked
<nikolar> sortie: porting latex seems like a pain and a half
<heat_> in any case one can also write their resume in GROFF
<nikolar> true dat
<sortie> nikolar: porting latex seems like an underfull \hbox (badness 10000) in paragraph at lines 140--164
<nikolar> lol something like that
<pessimal> heat_: it's my buddy allocator
<heat_> rendered as a man page, and as a pdf, and printed, groff is perfect
<nikolar> groff is love, groff is life
<kof673> for a split second i thought mjg had returned, srange
<kof673> *strange
<heat_> until recently the C standard was written in nroff
<sortie> heat_: (Beself) I added some bold text on the verbs for structure. I didn't feel that more indention would work, would narrow the text too much and overflow the first page
<heat_> i think they switched to latex for C23
<heat_> OVERFULL H
<kof673> > roff is a descendant of the RUNOFF program by Jerry Saltzer, which ran on CTSS. Douglas McIlroy and Robert Morris wrote runoff for Multics in BCPL based on Saltzer's program written in MAD assembler. Their program in turn was "transliterated" by Ken Thompson into PDP-7
<kof673> scary, it predates unix
<sortie> heat_: Hope you like the updated version better, at least I do
<pessimal> I guess I could dress as muslmalloc, but #musl wouldn't like it
jedesa has joined #osdev
<heat_> sortie, that does look nicer and you might want to bold up the rest of your resume too
<sortie> Well I didn't want to overdo it
<heat_> pessimal, bugtracker
<pessimal> only #musl would get it
<heat_> threadedallocatingworkload
<pessimal> same
chiselfuse has quit [Remote host closed the connection]
xenos1984 has quit [Read error: Connection reset by peer]
<sortie> heat_: OK added a bit more bold in the skills section where it made sense
chiselfuse has joined #osdev
<heat_> ok heat_@
<sortie> heat_: Beself
heat_ is now known as heat
<heat> linux kernal
<sortie> mv heat temp
<sortie> mv heat_ heat
<sortie> mv temp heat
<sortie> _
<sortie> k I just failed the job interview there lol
<nikolar> heat ^= heat_
<heat> mv heat_ heat
<sortie> meanwhile heat is yelling at me about using rename5(2) to do it
<heat> atomic renames mon
<heat> AMEN
<sortie> I INB4'D YOU
<heat> what's rename5?
<sortie> Sorry I don't follow pokemon
<heat> linux has renameat2
<sortie> reman meat?
<sortie> ramen
<sortie> absolute fools for us they have played
<heat> because obviously rename(oldpath, newpath) -> oh this dirfd thing is a good idea, renameat(olddirfd, oldpath, newdirfd, newpath) -> hmmm we need some flags here, renameat2(olddirfd, oldpath, newdirfd, newpath, flags)
<sortie> Basically always a good idea to add flags to a syscall
<heat> openbsd still hasn't learned the flags argument lesson so a bunch of syscalls do not have them
<heat> it was the main problem behind adding literally mimmutable()
<nikolar> maybe they didn't want to change old syscalls or something
<nikolar> i don't know
<heat> mimmutable() is pretty new
<heat> like.... 2 years old
<nikolar> right
<heat> so no excuse for not learning the fucking lesson
vai has joined #osdev
Nixkernal has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
<pessimal> rename6 when
<pessimal> renames gotta be atomic, or you'll break s6-rc
eddof13 has joined #osdev
<heat> rename is always atomic
xenos1984 has joined #osdev
archa has joined #osdev
eddof13 has quit [Quit: eddof13]
kof673 is now known as kof674
<kof674> gotta get into costume
levitating has joined #osdev
eddof13 has joined #osdev
Nixkernal has joined #osdev
X-Scale has joined #osdev
levitating has quit [Ping timeout: 252 seconds]
eddof13 has quit [Quit: eddof13]
bauen1 has quit [Ping timeout: 252 seconds]
urandom_ has quit [Remote host closed the connection]
<bslsk05> ​paste.rs: Source Code | dOlDl | Rocket Powered Pastebin
<chiselfuse> heat: sorry i know it's getting boring but the chromium binary leaves an empty page between every load segment in memory, do you happen to know why? some kind of safety thing?
<heat> i don't know
urandom_ has joined #osdev
levitating has joined #osdev
<zid`> sounds reasonable at least
<zid`> chrome is mega hardened generally, and that'd stop like, rodata oob ending up writable or whatever
<heat> that will never happen
<heat> it might be a mitigation of some sort, but i can't mindread lld
bauen1 has joined #osdev
eddof13 has joined #osdev
_ngn has quit [Remote host closed the connection]
_ngn has joined #osdev
<chiselfuse> i thought the compiler generated them
Left_Turn has quit [Remote host closed the connection]
Left_Turn has joined #osdev
levitating has quit [Ping timeout: 252 seconds]
Left_Turn has quit [Remote host closed the connection]
<zid`> linker places things
<zid`> that's what it do
Left_Turn has joined #osdev
<zid`> take lots of symbols, place them and lay them out in memory, resolve all the labels to addresses
<zid`> compiler doesn't know about other .o files so it can't know what addresses things will have, and thus can't resolve anything
<pessimal> linker links stuff
levitating has joined #osdev
<chiselfuse> i can't find formal info on how an elf is supposed to be loaded (shared objects with and without interpreter, and executables)
<chiselfuse> all those documents say to go to processor supplement which i can't find
levitating has quit [Client Quit]
<chiselfuse> am i supposed to just read the source of execve now
<heat> there are no docs
<heat> hth
<bslsk05> ​github.com: Onyx/kernel/kernel/binfmt/elf.cpp at master · heatd/Onyx · GitHub
<chiselfuse> is this yours?
<heat> yes
<chiselfuse> heat: what do you mean there are no docs? do you just guess that you're supposed to mmap load segments and somehow figure what rip should be set to etc?
<heat> yes
<heat> i mean rip is pretty obvious, should be set to e_entry
op has left #osdev [#osdev]
<chiselfuse> how about all other things like whether you have to load it at the actual virt addresses or if it's position independent
<chiselfuse> how you load the interpreter along with it if it has one
<chiselfuse> how you pass arguments and envs
<heat> gotta guess and read code
<heat> arguments and environment is well defined by the sysv abi though, i believe
<chiselfuse> so the standard is set by code in the linux/bsd/etc kernels?
<heat> yep, welcome to unix
<heat> you're lucky someone even wrote things down!
<heat> linux loads all sorts of non-compliant ELFs for legacy reasons
<heat> there are all sorts of fun technically-compliant ELF executables you can craft that will _never_ be loaded by any UNIX kernel because they're simply insane and bad
<chiselfuse> do you think it's doable to get a somewhat accurate idea by reading execve source in linux or is it haywire?
<kof674> https://github.com/GregorR/gelfload there is or was that but likely incomplete, and guessing a bit old. i can confirm mingw32 gcc4 can compile it and works under wine with winelf toolchain :D anyways, that page says gnu/linux and os x at least
<bslsk05> ​GregorR/gelfload - gelfload is Gregor's ELF loader. It is a usermode loader for ELF executables, used for two purposes: 1) Creating ELF environments on otherwise ELF-hostile platforms (e.g. Mac OS X and Windows) 2) Cross-loading ELF binaries intended for different platforms. (4 forks/34 stargazers/NOASSERTION)
<kof674> *with binaries from winelf toolchain lol
<heat> chiselfuse, you should read mine because it does exactly what you want it to do, and it's probably a good bit simpler
<chiselfuse> maybe i just manually craft ELFs to experiment and pause and look at memory with gdb to answer questions
<chiselfuse> heat: what features of cpp do you use in that codebase?
<heat> i don't see how that gains you anything
<heat> dude, it's the C-est C++ you'll ever see
<chiselfuse> okay i'll look
<heat> with C23 it's probably almost straight C given they have auto and nullptr lol
<chiselfuse> heat: so far i've answered questions i had by compiling with different settings and looking at /proc/pid/maps and guessing how it handled different things
<heat> i don't know why you have so many questions about ELF, nor do I understand what you're trying to do
Matt|home has quit [Read error: Connection reset by peer]
<heat> ELF is one of those formats where the more you think about it, the more questions you get, and those questions are generally stupid (the answer is always the obvious one)
<chiselfuse> i'm just bothered because i don't know how the program's initial state is reached (before we can say that it just executes at rip) along with how dynamic linking etc works
<chiselfuse> idk there's no reason, i just feel uneasy when i see a linker error or a segfault
<chiselfuse> because i don't have the full picture
<heat> kernel reads ELF header, kernel reads program headers, kernel mmaps, kernel sets up ELF auxv, kernel jumps to e_entry
eddof13 has quit [Quit: eddof13]
<chiselfuse> woah this cleared everything up now i am at peace
<chiselfuse> :p
<heat> not sure what else you want to know?
<heat> the other details aren't interesting if you're not implementing an ELF loader
<kof674> https://github.com/taviso/loadlibrary how much meta can you handle
<bslsk05> ​taviso/loadlibrary - Porting Windows Dynamic Link Libraries to Linux (379 forks/4340 stargazers/GPL-2.0)
eddof13 has joined #osdev
<chiselfuse> i don't know what i want either, just let me on about it until i feel bored lol
<heat> ELF (to the kernel) is basically a format that lists a bunch of mmap()'s it wants done (program headers), and where you want to start (e_entry)
<heat> the program header offset and vaddr restrictions are _literally_ designed for mmap, because of course, this thing was designed in a very adhoc fashion
<heat> when a dynamically linked executable is involved, it just tells you where to find the interpreter, and you do it. boom, you loaded two executables instead of one. the interpreter will do the hard bit of dynamic linking for you
<chiselfuse> kof674: that gelfload looks pretty small, you say it's likely incomplete?
<kof674> no idea, just needed it to test winelf toolchain. i can confirm helloworld from mingw32 works running gelfload with wine lol
<kof674> "needed" is a strong word
eddof13 has quit [Quit: eddof13]
<kof674> it was sitting in my pile of toolchains from a few years back
Patater has quit [Quit: Explodes into a thousand pieces]
eddof13 has joined #osdev
Patater has joined #osdev
alice has quit [Read error: Connection reset by peer]
Irvise has quit [Ping timeout: 244 seconds]
Irvise has joined #osdev
ad__ has quit [Read error: Connection reset by peer]
dostoyevsky2 has quit [Ping timeout: 244 seconds]
ad__ has joined #osdev
dostoyevsky2 has joined #osdev
puck has quit [Ping timeout: 244 seconds]
puck has joined #osdev
alice has joined #osdev
xvmt has quit [Ping timeout: 252 seconds]
griddle has joined #osdev
netbsduser has quit [Ping timeout: 255 seconds]
bauen1 has quit [Ping timeout: 276 seconds]
griddle has quit [Quit: griddle]
netbsduser has joined #osdev
Turn_Left has joined #osdev
archa has quit [Ping timeout: 276 seconds]
Matt|home has joined #osdev
Left_Turn has quit [Ping timeout: 244 seconds]
<kof674> *hello world built using winelf, mingw-built gelfload, run gelfload with wine to load the hello.elf. think that is right
<chiselfuse> has anyone here ever considered this idea: https://www.usenix.org/conference/osdi14/technical-sessions/presentation/devecsery
<bslsk05> ​www.usenix.org: Eidetic Systems | USENIX
<the_oz> oh you mean a hard disk?
<chiselfuse> i really like the concept but i don't know if it's practical enough or if others consider it useful too
<the_oz> we can etch state into it and read it back later
<the_oz> the next big change is probably gonna be persistent ram via intel
<GeDaMo> Didn't they stop making that?
<the_oz> did they? welp
<zid`> sounds massively wasteful to me
xenos1984 has quit [Ping timeout: 252 seconds]
<zid`> track the things you wanna track
<zid`> don't track the things you don't
<chiselfuse> the_oz: that person used a hard disk to implement it, a hard disk doesn't realize the concept alone
xenos1984 has joined #osdev
<chiselfuse> zid`: conceptually you could track anything ever done
<zid`> Yes, and I am saying I practically don't care
<bslsk05> ​spectrum.ieee.org: Memristor Breakthrough: First Single Device To Act Like a Neuron - IEEE Spectrum
<chiselfuse> zid`: it would at least kill drm
gog has joined #osdev
Gooberpatrol66 has joined #osdev
eddof13 has quit [Quit: eddof13]
zaquest has joined #osdev
FireFly has quit [Ping timeout: 248 seconds]
X-Scale has quit [Quit: Client closed]
FireFly has joined #osdev
eddof13 has joined #osdev
077AAT1JQ has quit [Quit: quit]
griddle has joined #osdev
exark has joined #osdev
X-Scale has joined #osdev
vai_ has quit [Ping timeout: 252 seconds]
xenos1984 has quit [Ping timeout: 252 seconds]
bauen1 has joined #osdev
xenos1984 has joined #osdev
Artea has quit [Quit: ZNC 1.9.1 - https://znc.in]
kof674 has quit [Ping timeout: 240 seconds]
hwpplayer1 has quit [Quit: I'll be back later]
griddle has quit [Quit: griddle]
griddle has joined #osdev
the_oz has quit [Remote host closed the connection]
the_oz has joined #osdev
eddof13 has quit [Quit: eddof13]
jistr has quit [Remote host closed the connection]
jistr has joined #osdev
_ngn has quit [Ping timeout: 260 seconds]
_ngn has joined #osdev
bauen1 has quit [Quit: leaving]
GeDaMo has quit [Quit: 0wt 0f v0w3ls.]
eddof13 has joined #osdev
pessimal is now known as Ermine
bauen1 has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
eddof13 has quit [Quit: eddof13]
xenos1984 has quit [Ping timeout: 252 seconds]
xenos1984 has joined #osdev
jedesa has quit [Quit: jedesa]
jedesa has joined #osdev
<heat> ah yes, my new mm stress test: building cmake
<heat> gotta love building C++ projects
xenos1984 has quit [Ping timeout: 260 seconds]
FreeFull has quit []
FreeFull has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
jedesa has quit [Remote host closed the connection]
netbsduser has quit [Ping timeout: 252 seconds]
X-Scale has quit [Ping timeout: 256 seconds]
craigo has quit [Ping timeout: 252 seconds]