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
ghee has joined #osdev
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
ghee has quit [Remote host closed the connection]
ghee has joined #osdev
lkurusa has quit [Quit: I probably fell asleep (or went out). Who will ever know.]
gog` has quit [Read error: Connection reset by peer]
gog` has joined #osdev
elastic_dog has quit [Ping timeout: 244 seconds]
ghee has quit [Quit: EOF]
elastic_dog has joined #osdev
heat has quit [Remote host closed the connection]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
chartreuse has quit [Quit: Leaving]
gildasio1 has joined #osdev
gildasio has quit [Remote host closed the connection]
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
junon has joined #osdev
<junon> Writing a rasterizer for the vesa linear framebuffer. I already have scrolling text buffers and whatnot but trying to optimize a bit (running a debug build over GTK Broadway backend between two computers in order to develop on WSL lol - great simulation of a ridiculously slow system).
<junon> Trying to figure out a good way of doing scrolling without having a memory pager in place yet. Double buffering is out of the question since I can't allocate memory yet, and the language I'm using doesn't have VLAs. Seems that reading from the video buffer is... well, buggy/slow at best and nonfunctional at worst.
<zid> memcpy and flip?
<junon> Am I doomed to re-render all of the glyphs when shifting text up a line?
<zid> assuming you have enough video memory
<junon> memcpy from where, thought? reading from the framebuffer gives strange results.
<zid> I have my qemu graphics double buffered because it allows you to set a y position for the scan-out so I just made whatever res uses exactly half
<zid> and swap between y=0 and y=768 or whatever it was
<zid> if you can't read the fb you need to triple buffer
<zid> and have an external copy
<zid> If you're not going to triple buffer you should probably at least make a glyph cache
<zid> render each glyph to some array so that you can just blit them all later
<junon> mrh okay. So I'll need to allocate a region of memory prior to the memory pager taking over.
<junon> Or yeah, a glyph cache would at least speed things up somewhat.
<junon> Instead of decoding them each time.
<zid> You basically have to in modern typefaces
<zid> ttf are fucking complicated
<junon> I build a TTF cache at build time using graphicsmagick.
<zid> and it's all kerned and shit, so the UI in your game or whatever will be rendered to texture, then the texture will be lifetime managed
<junon> I mean, sorry. Glyph atlas from a TTF.
<zid> monospace is easier you can atlas it yea
<junon> Yeah just 100 monospace glyphs or whatever
<mrvn> junon: never read the framebuffer, it's horribly slow. If you can't double buffer then re-render
<junon> and glyph 0 is inverted to be used as the "unknown character" glyph.
<junon> mrvn: Yeah thought so. Glyph cache it is, then.
<mrvn> A bitmap font is it's own cache
<junon> That's what it is, yeah. It's just unpacking the bits each time. Idk if maybe unpacking them once into the pixels... wait no can't do that either, because if the color changes then I have to update all of them in the cache.
<mrvn> junon: use a 8 bit wide font
<junon> Why 8 bit specifically?
<junon> (currently 6 bits)
<mrvn> so it's bitmap[c][row]
<zid> You can use an atlas for kerned fonts I think as long as your kerning rules are simple, like it's just pairs or whatever
<junon> good idea mrvn, currently doing the div/mod song and dance.
<mrvn> at least expand the 6bit with 2 padding bits.
<junon> yeah exactly
<mrvn> but why don't you have any memory for a double buffer?
<junon> I'm also clearing the scroll region then only painting the glyph "hits" with the foreground color when re-rendering. That's basically hitting the scroll region on average 50% more than necessary.
<zid> doesn't really work for those languages that compose all their glyphs though :P
<junon> I do, of course. Just don't have a memory pager at this point in the boot stage.
<mrvn> junon: huh? jus redraw all the glyphs that differ from the previous line top to bottom.
<junon> Good idea
<mrvn> junon: Put 1MB of memory in the .bss section and use that for an early kalloc()
<junon> will 1mb cover all framebuffer cases though?
<mrvn> make it 16MB
<junon> I thought they could be as large as a 4k monitor for example
<mrvn> it's not like .bss is costing you anything
<zid> ah no it doesn't work for kerning it turns out, you need to do weird shit like mipmaps for how it's x-positioned, as kerning info is noticeable sub-pixel
SpikeHeron has quit [Quit: WeeChat 3.6]
<junon> that's... true. You're right.
<mrvn> zid: things like antialias and kernel only makes sense above 12-16 pixel.
<mrvn> kerning
<mrvn> junon: why isn't the memory the first thing you set up on boot?
<junon> haven't gotten there yet.
<mrvn> there are tons of drivers that will need some buffers so it's kind of important.
SpikeHeron has joined #osdev
<mrvn> junon: I would recommend sticking with the text console then and work on memory before doing FB
<mrvn> or serial output
<junon> I'm writing this in rust, to save time I'm using the `bootloader` crate which doesn't properly disable framebuffer mapping despite telling it to. Figured I'd have to write the rasterizer at some point for the boot info and had a few days to kill to do it. So started there.
<mrvn> but whatever is fun for you
<junon> Yeah it's fun for me :) that counts too hehe
<mrvn> don't worry about speed then at least. just do the simplest thing possible so you can read printf() debugging output.
<junon> Yeah definitely. It works now, looks great, etc. Just slow. But the clear + re-render can be trivially sped up with the few tricks you mentioned. Appreciate it :)
<mrvn> .oO(including not scrolling but simply wrapping around to the top)
<junon> nah scrolling works, it's just flickering and slow haha
<mrvn> I did that when I worked on MIPS with an FB. Just keep a clear line between the last line and the old text and use the FB like a ring buffer.
<junon> works way better now, thanks again zid/mrvn :)
<zid> what did you change?
tsraoien has quit [Ping timeout: 245 seconds]
<junon> Made "draw_glyph_opaque" variants that don't skip transparent glyph bits and instead write the background color, which saves having to blank the line when re-rendering the line below it. Then once I hit a null byte in that line (marking the end of the line's contents), I just blank the rest of the line.
<junon> No more full-region blank prior to re-rendering.
<junon> Then I just blank the last line entirely.
<zid> ah yea that sounds nicer than whatever you were trying before
<junon> No more flickering and markedly faster.
<junon> Yep :)
<zid> I didn't even consider you might be manually clearing then rendering transparent text
<junon> Yeah haha, I was trying to make things too nice and fancy. Forgot I'm writing rudimentary displays.
<zid> write combining is your friend :p
<junon> Thanks again :) time for bed. Night!
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
<mrvn> junon: You can also create a buffer of 1 line or better one row of characters. Render into that and then memcpy it to the framebuffer.
<junon> Are video buffer writes also slow?
<junon> Or just reads?
<zid> as slow as the dram on the card is
<zid> so if it's a real vesa card? very
<junon> ah so a word sized copy is going to be faster than doing individual bytes etc.
<zid> If it's just your nvidia card pretending to decode those addresses? fast
<zid> that's going to be faster regardless just because it's 1 packet and not 4 packets
<zid> even to main ram
<junon> Is there ever a case where the pixel format will be >4 bytes?
<junon> or, well, pixel stride
gildasio1 has quit [Quit: WeeChat 3.6]
opal has quit [Remote host closed the connection]
<zid> I mean, ever? yes. In practice? no.
<zid> I could happily define a 17 byte pixel format in my mind
<zid> with 8 bytes of padding
<zid> getting a vendor to support it is hrader
opal has joined #osdev
<junon> CMYK or RGBY as ieee floats + 1 byte unsigned alpha :D
<junon> Yeah okay, makes sense.
foudfou has quit [Remote host closed the connection]
Vercas has quit [Write error: Connection reset by peer]
dude12312414 has quit [Remote host closed the connection]
foudfou has joined #osdev
dude12312414 has joined #osdev
<junon> I have a fallback format if the pixel format is known that writes up to 8 bytes of grey values (so all of my colors are RGB+grey, and one of the two are selected based on the currently indicated pixel format).
Vercas has joined #osdev
<mrvn> junon: 16bit per color channel highend displays for artists?
<mrvn> junon: RGBY? Reg Green Blue Yellow?
<junon> Yeah
<junon> was trying to figure out how to make a 17byte pixel format make sense.
<mrvn> CMYKA with flats.
<junon> that gets you 20 bytes if you have a float alpha channel
<junon> 3 bytes too many haha
<zid> 17 is easy, 1 byte alpha and 4 channel colour of float/u32 each
<junon> yeah exactly
<mrvn> not enough alpha: 30bit per color, 14bit alpha
<zid> red green blue and octarine
<junon> or 17 bit floats for CMYKA with an extra bit for ... something.
<mrvn> UVYAU'V'Y'A' so you can do a spline through the pixels.
<junon> haha
<mrvn> perfect for scaling
<junon> okay time for actual bed
* junon leaves quietly
<mrvn> that wasn't quiet, you announced it
* gog enters loudly+
pretty_dumm_guy has quit [Quit: WeeChat 3.5]
tsraoien has joined #osdev
liz has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<bslsk05> ​wiki.multimedia.cx: RGB - MultimediaWiki
Vercas has quit [Remote host closed the connection]
opal has quit [Remote host closed the connection]
Vercas has joined #osdev
opal has joined #osdev
tsraoien has quit [Ping timeout: 252 seconds]
ThinkT510 has quit [Ping timeout: 245 seconds]
pounce has quit [Remote host closed the connection]
pounce has joined #osdev
ThinkT510 has joined #osdev
ThinkT510 has quit [Read error: Connection reset by peer]
MrBonkers has quit [Remote host closed the connection]
ThinkT510 has joined #osdev
* moon-child pets gog
* moon-child is annoyed to finds that cats cannot be pet in nethack
<gog> dang
<gog> better add that
<gog> also gotta try to figure out who it was that i talked to that has commit prvileges on unnethack
[itchyjunk] has quit [Remote host closed the connection]
<moon-child> bhaak?
<gog> no idk i swear i knew somebody but maybe i misremembered
gog has quit [Ping timeout: 252 seconds]
<zid> You can #chat to it though
<zid> which basically does the same thing to pets
<klys> i've been looking for a third party wiki bookmark on halftone, wiki may have expired and gone to the web archive.
<zid> I updated my enigma machine to not suck
<zid> but I don't dare run it against the test input with 3 rotors, plug wires, and rotor positions
<klys> mythtv wiki not it, avisynth wiki not it, ffmpeg wiki not it, vlc wiki no article, multimedia wiki no article; nothing on gamma correction either
<zid> never heard of it
<moon-child> zid: clearly, you have never pet a cat
<klys> sorry, it was a bookmark I almost could swear I made, except I have like four computers here with ~two browsers each, mebby it's on the imac...would take some work tho
* zid points at his cat
<zid> I call her a shitty kitty
<zid> she looks at me and purrs
foudfou_ has joined #osdev
foudfou has quit [Ping timeout: 268 seconds]
ajr has quit [Quit: WeeChat 3.6]
vdamewood has joined #osdev
opal has quit [Ping timeout: 268 seconds]
foudfou_ has quit [Remote host closed the connection]
foudfou has joined #osdev
lkurusa has joined #osdev
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lkurusa has quit [Client Quit]
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
liz has quit [Quit: Lost terminal]
zaquest has quit [Remote host closed the connection]
zaquest has joined #osdev
vdamewood has joined #osdev
bradd has quit [Ping timeout: 268 seconds]
bradd has joined #osdev
elderK has quit [Quit: Connection closed for inactivity]
the_lanetly_052 has joined #osdev
sprock has quit [Ping timeout: 272 seconds]
sikkiladho_ has joined #osdev
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
ripmalware__ has quit [Remote host closed the connection]
ripmalware__ has joined #osdev
myon98 has joined #osdev
sikkiladho_ has quit [Quit: Connection closed for inactivity]
GeDaMo has joined #osdev
darkstarx has joined #osdev
darkstardevx has quit [Ping timeout: 272 seconds]
pretty_dumm_guy has joined #osdev
scoobydoob has joined #osdev
scoobydoo has quit [Ping timeout: 276 seconds]
scoobydoob is now known as scoobydoo
miezekatze has joined #osdev
miezekatze has quit [Quit: WeeChat 3.6]
Brnocrist has quit [Ping timeout: 268 seconds]
Brnocrist has joined #osdev
m3a has quit [Quit: leaving]
mzxtuelkl has joined #osdev
eroux has quit [Ping timeout: 245 seconds]
eroux has joined #osdev
bauen1 has quit [Quit: leaving]
bauen1 has joined #osdev
gildasio has joined #osdev
Vercas has quit [Write error: Connection reset by peer]
foudfou has quit [Remote host closed the connection]
Vercas has joined #osdev
foudfou has joined #osdev
ripmalware__ has quit [Remote host closed the connection]
ripmalware__ has joined #osdev
lkurusa has joined #osdev
gog` has quit [Ping timeout: 268 seconds]
<zid> My enigma machine doesn't work
<bslsk05> ​gist.github.com: enigma_api.c · GitHub
gog has joined #osdev
<vdamewood> zid: Did you try asking Ada Lovelace for help?
<zid> she's been dead a long time
<vdamewood> zid: That explains why she never returns my calls.
<zid> She's so dead she didn't even have a phone
<vdamewood> Is Turing dead too?
<vdamewood> Damn, so many good coders are dead.
<vdamewood> Serious question: Did the enigma machine really use a 26-letter alphabet?
<friedy> Go ask Arthur Scherbius
<friedy> But yeah I think it used the 26-letter alphabet.
bradd has quit [Ping timeout: 245 seconds]
<vdamewood> Yeah, the Wikipedia article has a picture of one. It has a slightly modified QWERTZ layout with only the 26-unaccented letters and no eszet.
bradd has joined #osdev
<vdamewood> P was moved to the left of the Y key, and L was moved to the right of the M key. There's also no punctuation.
<vdamewood> I guess the right hand rested on GHJK instead
sprock has joined #osdev
<mrvn> vdamewood: I don't think you 10-finger-typed on the enigma
<vdamewood> I only use 9 fingers on my computer.
<mrvn> Apart from having to read the encrypted text letzter by letter every press also has to rotate the wheels. Not sure what speed you could type on it.
<mrvn> -z
<vdamewood> 4 WPM
<vdamewood> But why have a qwertz layout if it's not meant for 'typing'
<vdamewood> ?
<vdamewood> An abcdef layout would probably be better if you were just hunting and pecking anyway.
<mrvn> Not if the word is Schiffereihafenkaptainspatent
<vdamewood> Gezundtheit
<mrvn> people are used to searching on a qwertz keyboard. But why the differences to qwertz?
<mrvn> vdamewood: bless you
<mrvn> The enigma messages hat a code book with most things encoded to single letters. So 4wpm could be just 4 letters.
<vdamewood> My guess is that they make the layout more symetric. Without punctuation, P and L just kind of hang out to the right.
<mrvn> yeah, makes it nice and square
<zid> 26 is not composite enough
<zid> we should add 6 more letters to english
<zid> thorn, eth, and 4 more vowels
<mrvn> 32 only has 2 as prime factor
<mrvn> With 30 you could rotate letters in gorups of 2, 3 and 5 on different wheels of the enigma.
<mrvn> hmm, would that make it weaker?
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
[itchyjunk] has joined #osdev
puck has quit [Excess Flood]
puck has joined #osdev
tsraoien has joined #osdev
the_lanetly_052_ has joined #osdev
the_lanetly_052 has quit [Ping timeout: 252 seconds]
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
arminweigl_ has joined #osdev
arminweigl has quit [Ping timeout: 260 seconds]
arminweigl_ is now known as arminweigl
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
foudfou has quit [Remote host closed the connection]
Bonstra has quit [Quit: Pouf c'est tout !]
foudfou has joined #osdev
<dzwdz> are there any OSes that support write()s to negative offsets?
<dzwdz> where e.g. writing to -1 appends to the end of the file
<zid> write doesn't take an offset though?
<GeDaMo> seek to the end, write
<dzwdz> well
<dzwdz> yeah, on unix it doesn't, i kinda forgot about that...
<zid> and SEEK_END might actually be -1
<dzwdz> i was slightly basing my interface on 9p
<dzwdz> that was a stupid question
Bonstra has joined #osdev
<gog> SEEK_END is 3
<zid> shame
<zid> gog: Did you see my enigma machine?
<gog> i didn't
<zid> It's great, it doesn't work right.
<bslsk05> ​gist.github.com: enigma_api.c · GitHub
<gog> neat
<zid> It solves level 1 of the challenge with 1 rotor, but level 3 uses 3 rotors, rotor staring positions, and the plugboard
<zid> and doesn't give the right answer
<zid> I have no idea why not
<dzwdz> lemme try again - in my OS, read() and write() accept an offset. do y'all think it'd be a good idea to accept negative offsets from the end of the file?
<dzwdz> my reasoning being that it would allow atomic appends
<zid> I might try put some standard settings in
<clever> dzwdz: that sounds more like pread/pwrite?
<gog> do read and write not have a concept of current position?
<gog> how do you specify that?
<clever> read/write just advance the seek position by however much they wrote, and dont accept a position, so you must seek seperately
<mjg> in unix i presume, r/w offset is tracked per file pointer
<clever> pread/pwrite dont change the seek position at all, and take a starting position as an arg
<jjuran> POSIX has atomic appends via O_APPEND, of course
<dzwdz> well, yeah, pread/pwrite
<dzwdz> i just forgot i didn't implement it the unix way
<gog> right ok
<gog> i see
<dzwdz> O_APPEND seems kinda weird to me, why should i have to choose between being able to append atomically and writing anywhere else in the file
<gog> it's probably fine but might make it hard to port standard applications
<dzwdz> i'm going to have a posix compatibility layer anyways
<gog> if that's not a concern for you then you can make the API whatever you want
<dzwdz> in userland
<gog> cool cool
<dzwdz> but i'm just trying to decide what the internal api for drivers and such should be
<bslsk05> ​www.theregister.com: There is a path to replace TCP in the datacenter • The Register
<gog> i might be starting what amounts to a paid internship helping refactor the application my company markets
<gog> good news because i found out yesterday that my current position is redundant because our client is canceling the contract
<GeDaMo> :|
<gog> I'm technically unemployed starting Monday
ajr has joined #osdev
<zid> gog: neat, we can be bums together
<gog> they want to keep me around, they just don't have quite enough for me to do just yet
<gog> so I'm in a bit of a limbo
<zid> can you do 3 days or something?
<zid> That's my ideal schedule tbh
<zid> Fuck the 'crunch crunch crunch', '120 week overtime' nonsense that US people seem so fond of
<gog> i might end up doing tech support for the application for a month while people are out on holiday
<zid> I'll put 4 hours in here and there to make something pretty
<gog> but we don't have a final end date for what I'm doing now just yet
<gog> in the mean time i have to continue to do it while the client strings us along
<zid> gog startup when
<gog> this is a startup lmao
<zid> but not a gog startup
<gog> true
<gog> but I don't have any marketable ideas
<zid> "Gog Industries, Meow. Ltd. Nyan."
<gog> I'm not concerned with things like making profit
<zid> your logo can be a cat-face-shaped-cog
<gog> ew
<friedy> zid: That 120 week overtime is the reason our big tech companies exist.
<friedy> Or at least come into existence.
<zid> It's fine if it's your passion startup thing
<zid> but it does not fly for employees
Vercas6 has joined #osdev
foudfou_ has joined #osdev
<zid> It's not relegated to tech either, there's a lot of pro-capitalism sentiment I see in the US just in general. They're *proud* of working 100 hours a week.
<zid> High 'work-ethic' as a major virtue, some puritan thing I guess
foudfou has quit [Ping timeout: 268 seconds]
<friedy> I mean I wouldn't work 100 hours a week unless it was for my own thing, but I think capitalism created more jobs than the government did.
<zid> see, you're in that hole as well, you're already pre-programmed to think people need jobs, jobs are good, no job is bad, etc
gildasio1 has joined #osdev
<zid> lack of capitalism doesn't mean lack of jobs, it means lack of *need* for jobs
puck has quit [Excess Flood]
<friedy> Okay, then explain your programming.
puck has joined #osdev
<zid> I think horses are inc- wait you won't catch me that easily
<friedy> Actually like explain your idea. I'm interested.
<zid> idk, it just seems self-evident to me?
gildasio has quit [Remote host closed the connection]
<zid> people work the same or more hours as they ever did, despite rapid progress in efficiency
Vercas has quit [Ping timeout: 268 seconds]
<zid> all that happened is that profits for CEOs went up
Vercas6 is now known as Vercas
<zid> and the system is set up so that not having a job, both culturally and logistically, is rather untenable
<zid> despite most corp jobs being useless busiwork
<zid> A bullshit job or pseudowork[1] is meaningless or unnecessary wage labour which the worker is obliged to pretend has a purpose.[2] Polling in the United Kingdom and the Netherlands indicates that around 40% of workers consider their job to fit this description.
<GeDaMo> I feel like Americans would decry you as "socialist" :P
<zid> It's not culturally allowed to just pay people to exist, or cover their expenses, they have to get that from a *job*. Which requires the creation of useless jobs.
<zid> and communist, and liberal, and a hipster, and probably a whole dictionary of words they can't spell :p
<GeDaMo> The boogie man! :P
<friedy> Okay, so what's the point of having a bullshit job. It's not like corps actually need that.
<friedy> Like why pay workers to do nothing?
<zid> people are people, they will game the system if it's required to game it
<friedy> Ah I see
<GeDaMo> Managers build fiefdoms, more people, more power
<friedy> It's like an empire.
<GeDaMo> Every manager wants their own Death Star :P
<zid> look at japanese work culture, they work until their boss leaves the office regardless of whether they're doing any actual work
<zid> you could cut all that bullshit out and *everybody* would be happier
<zid> but it just isn't Allowed
Terlisimo has quit [Quit: Connection reset by beer]
<zid> In Japan it stems from their collectivist culture, in the west from christianity
<friedy> How does that stem from Christianity?
<mats1> puritan culture
<mats1> people don't really work that hard in the west anyway
<zid> It's virtuous to struggle
<mats1> buncha whingers
<mats1> oh noes, working five days a week!11
<zid> It doesn't count unless you suffered while you did it
Terlisimo has joined #osdev
<mats1> japan is what happens when socialists take all the risk out of the system
<mats1> pumping endless state money to support national champions and japanese corps
<friedy> It's virtuous to struggle if what you are struggling for actually has really positive impact on the world. Is it not?
xenos1984 has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
<GeDaMo> Putting money into the pockets of the wealthy is 'virtuous' now? :|
<friedy> A corporation can make workers feel like their work is meaningful when it is actually not.
<GeDaMo> Corporations are paperclip maximizers
<GeDaMo> Except they try to maximize profit
<friedy> Besides some of my friends are aware that they are doing monkey work, but they still work there for the money because they get paid so well.
troseman has quit [Ping timeout: 268 seconds]
<friedy> 10 B.S git pushes = $$$
<friedy> So how about that OS dev?
<GeDaMo> :D
ripmalware__ has quit [Read error: Connection reset by peer]
bauen1 has quit [Ping timeout: 252 seconds]
<friedy> Anyone want to write an OS in google carbon?
<zid> friedy: So you agree, then, basically.
<zid> <friedy> Besides some of my friends are aware that they are doing monkey work, but they still work there for the money because they get paid so well.
<zid> You realize the *job* is pointless, it's just that society doesn't allow them to live not having done fake work.
<zid> You could just take the profit straight from the company and give them the money directly and *nothing* would change economically.
<zid> Except maybe they'd have more free time to be an artist or whatever
<gog> comrade zid
<mjg> bullshit jobs is a real concept
<gog> yes
<mjg> and i don't only mean middle management :-P
<gog> my job is a bullshit job
<gog> (sing to the tune of "awesome god")
mzxtuelkl has quit [Quit: Leaving]
<zid> I don't know the tune to that though
<zid> can I sing it to the tune of golden brown
<gog> ok
<jimbzy> Haha
<jimbzy> Ain't heard that one in a while, gog.
gildasio1 has quit [Remote host closed the connection]
gildasio1 has joined #osdev
<gog> :p
nyah has joined #osdev
seer has quit [Quit: quit]
seer has joined #osdev
k8yun has joined #osdev
FreeFull has joined #osdev
SGautam has joined #osdev
ripmalware has joined #osdev
<friedy> zid: Yeah, I agree.
<friedy> What I don't know is how to fix the problem.
<zid> guillotine?
<friedy> Like the government would have to start paying people.
<friedy> zid: I guess I'll just wait for AI to automate all the busy work.
<zid> nah
<zid> we'll still somehow have to have jobs
gildasio1 is now known as gildasio
<zid> 14 people will live like it's some utopian future
<zid> the rest of us will live in caves growing mold
<friedy> the rest of us could just live in VR.
gildasio has quit [Remote host closed the connection]
<zid> (This is actually the plot of the time machine)
gildasio has joined #osdev
<friedy> Okay, so I guess I have to become a big tech CEO before it's too late.
<zid> nope, morlock life for you
<friedy> but I like sunlight.
<friedy> I want that Eloi life
<zid> are you, or have you ever been, a psycopath or billionaire?
<friedy> No, I have compassion and empathy for others.
ripmalware has quit [Ping timeout: 252 seconds]
<friedy> I just everyone to live a good life without being exploited by corporate maniacs.
<friedy> Which is hard to do for obvious reasons.
<mats1> perhaps the natural condition of man is slavery
<zid> Yea you'r 100% morlock
<friedy> Man must work for a living.
<zid> If you're not a billionaire or psycopath (pre-billionaire) you're not eloi
the_lanetly_052_ has quit [Ping timeout: 245 seconds]
<mats1> give me a break
<mats1> if you live in the west, the median person is a well kept house slave, and perhaps as many as 100 million of them live in eloi conditions
<mats1> it is ~everyone else~ that is morlock
<mats1> you know, like the foreigners that pick your produce and deliver it to the grocer
xenos1984 has quit [Read error: Connection reset by peer]
<friedy> One could say that it is hierarchy
<psykose> who let the 5-length usernames speak again
k8yun has quit [Ping timeout: 244 seconds]
<mats1> if you don't like it, and that's understandable, try asymmetrical warfare on your local govt
k8yun has joined #osdev
<zid> psykose: I think it's the water round here
<mats1> most muni bonds are junk tier and their govts can hardly afford to pay their staff living wages, having to pay survivors benefits might make the difference
xenos1984 has joined #osdev
<gog> y'all ever develop an operating system
<junon> this channel has the wildest conversations.
<junon> "Disassembler disagrees with translator over instruction decoding" what's the likelihood of this being a bug in Rust, LLVM, or QEMU? Works in release, not in debug.
<mjg> yes
<junon> great thx
<junon> :D
<mjg> you should be able to decode yourself
<junon> I would imagine this is probably not a bug in QEMU's decoding. Likelihood seems slim.
<junon> And this is machine code generation, so probably not Rust's frontend.
<junon> So... bug in LLVM's x86_64 backend?
dh` has quit [Quit: bbiab]
<zid> translator?
<junon> Or is my deductive reasoning here flawed
<zid> and which disassembler?
<junon> This is output from QEMU during execution.
<junon> translator probably refers to TCG?
<zid> cpu trace?
<junon> I'm speculating though.
<zid> that's handled by capstone
<junon> yeah
<junon> Or do you mean, do you want a dump
aki has joined #osdev
aki is now known as hypoalgesia
hypoalgesia is now known as help
<zid> same as IDA!
help is now known as hypoalgesia
<junon> Yeah so it's proooobably not capstone.
<jimbzy> junon, Is your nickname from Final Fantasy VII?
<zid> I personally hate capstone's syntax choices
<junon> Anyone know how to get gdb to show bytes?
<zid> who the fuck decided mov eax, var should mean mov eax, [var]
<zid> x
<junon> jimbzy: Nope, ROSE online.
<zid> /32bx
<zid> or 32i for instructions, or g for giant words or whatever (maybe q for quad)
<zid> you get the idea anyway
<jimbzy> Junon Polis?
<junon> jimbzy: Junon is the planet, Junon Polis is the capital city :)
<jimbzy> I've never played it, but I am familiar.
<zid> wtf is an akram
<junon> Was a cute little game :)
<zid> or an arua
<junon> zid: Akram is the name of the kingdom, Arua is the name of the god of the religion those in the Akram Kingdom followed.
<zid> looks like a korean mobile grind mmo from 2018
<junon> You're off by about 10-15 years haha
<junon> but yes, correct.
<zid> so desktop but not mobile
<junon> yep
<zid> which adjusts the year by 10 automatically
<junon> zid: any way to show the bytes directly in `layout split`/`asm`?
<zid> I guess it'd be like being named like a genshin character today
<zid> what do you mean, directly
hypoalgesia has quit [Client Quit]
<zid> if you just want to see it after every step you could use display :P
hypoalgesia has joined #osdev
<junon> Here's the output. This is what is jumped to when calling a function. https://pastebin.com/raw/N8z3A78U
dh` has joined #osdev
_xor has quit [Ping timeout: 272 seconds]
<junon> lldb is disassembling it the same way.
<junon> So I doubt it's QEMU doing this. I'm betting on a bug in LLVM or something.
<junon> Then again I can't tell if these instructions make sense...
<junon> Actually they do. The function appears to be operating in accordance to the original code. So maybe this really is a QEMU bug.
<junon> Is there a way to disable TCG somehow?
<junon> Requires KVM I guess, which isn't available under WSL1. Drats.
<zid> you know you never actually describned the problem right?
dh` has quit [Quit: brb again]
foudfou_ has quit [Remote host closed the connection]
Vercas has quit [Remote host closed the connection]
foudfou has joined #osdev
dh` has joined #osdev
Vercas has joined #osdev
dh` has quit [Ping timeout: 252 seconds]
<netbsduser`> junon: if you are running on Windows you can use the WHPX backend of QEmu
<netbsduser`> in the alternative, HAXM if you run on intel
<junon> zid: an innocent, normal function call in Rust causes a triple fault.
<junon> netbsduser`: will try it
<junon> ugh matrix sucks, I keep forgetting to ditch it.
<netbsduser`> that's what the red pill is for
<junon> haha
<j`ey> junon: use -d option with qemu, might help
<j`ey> -d int, for example
<junon> I did, yeah. That's how I got the "translator and disassembler disagree" bit.
<junon> more specifically, turned it on directly prior to the function call via the qemu repl.
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
SGautam has quit [Quit: Connection closed for inactivity]
<zid> still not interested in actually telling us I guess
<junon> I've already said everything
<junon> function gets called, triple faults immediatel
<junon> only in debug mode
<zid> no
<psykose> there's a lot of steps in between, like the code, etc etc
<zid> you were going on about how the disassembly doesn't match
<zid> and what might cause that etc
<zid> but never actually showed the disassembly of either view
<junon> It's literally a normal function call
<junon> two instructions into the call after the jump, QEMU crashes
<zid> fwiw unless you emulate with nochain
<zid> don't trust qemu to tell you where it's crashing
<zid> I'd have said that first but you were talking about disassemblies not matching
GeDaMo has quit [Quit: There is as yet insufficient data for a meaningful answer.]
<mrvn> junon: time to fix your double fault handler.
<junon> there isn't one, there shouldn't be a fault at all.
<junon> This function worked fine in previous builds.
<mrvn> now is the time to write one
<junon> Yes
<mrvn> And when you have the double fault handler you can write the fault handler. Then you know what's causing it.
k8yun_ has joined #osdev
k8yun has quit [Ping timeout: 260 seconds]
ThinkT510 has quit [Quit: WeeChat 3.6]
elderK has joined #osdev
ThinkT510 has joined #osdev
torresjrjr has quit [Remote host closed the connection]
torresjrjr has joined #osdev
heat has joined #osdev
<heat> aw shit I was trying to join #webdev
<heat> misclicked
<zid> well, too late
<zid> you have to uninstall js now and install binutils
<kazinsal> what's that? bootloader in node?
<heat> I have one node.js installed
<heat> and like 5 or 6 different binutils
<heat> this is l0w l3v3l haxx0r syndrome
<clever> kazinsal: dont give me ideas, i already have lua in my bootloader....
<zid> how many copies of v8, spidermonkey, etc
<heat> 2 v8's and 1 spidermonkey
<kazinsal> This week I've been writing more JavaScript than anything else and it's... not great
<zid> delete those
<zid> someone explained to me how to use javascript yesterday
<zid> let exists, never use var
<kazinsal> It's not the worst thing I've written anything in but it feels weird and alien to me
<heat> yes
<heat> you should write ASL next
<zid> 12/f/cali
<heat> you'll get a fucking stroke
<zid> sorry, scripted response
<heat> lol
<clever> kazinsal: now that i think of it, i did use js+webusb to talk to an rpi before, which was running custom C code
<heat> it's better than being a pedo
<heat> it's acpi source language babeh
<clever> but the js was on a proper desktop machine, not a ram-less system, lol
<zid> It's just a restraining order heat it doesn't count okay
foudfou has quit [Ping timeout: 268 seconds]
<heat> here's an on-topic Fun Fact(tm): QEMU supports S3 suspend and resume
<heat> unfortunately it resumes right after it suspends
<clever> heat: ive had trouble when darwin tries to suspend though, its doing something different from the spec i think
<clever> it took a lot of work to be able to disable automatic suspend from a shell script
<heat> might be a firmware bug
<clever> it was just stock EDK2 i think
<heat> OVMF does support S3
<heat> S3 is a fucking nightmare to support though
<clever> ah no, OVMF
<heat> it's inzane
<heat> OVMF is in EDK2 lol
<clever> and here i am, planning suspend to ram on an rpi :P
<bslsk05> ​github.com: edk2/OvmfPkg at master · tianocore/edk2 · GitHub
<clever> ah, and its also tianocore
<clever> just pick one name, and stick with it! lol
<heat> it's everything
<heat> it used to be tiano
<heat> then it grew into tianocore, edk was the efi development kit, then udk was the UEFI development kit, now we have edk2 which is efi development kit 2
<heat> tianocore is not actually an entity
<clever> and how is efi different from uefi??
<heat> EFI is old UEFI
<zid> does that mean heat is old heut
<clever> just like how a usb1 only device is usb2 compliant? :P
<zid> heaut
<heat> clever, kinda
<heat> they deprecated some stuff
<heat> but it has been remarkably stable
<clever> but they also change what a name means
<heat> hm?
<clever> so what was one day just UEFI, is now called EFI
<clever> and there is a totally new thing, that is now called UEFI?
<clever> 2022-07-28 18:32:09 < heat> EFI is old UEFI
<heat> first, there was EFI
<heat> then, EFI changed to UEFI
<heat> and erm yes that's it
<clever> ahh
<clever> misread what you said
<heat> people referring to EFI these days are old heads or force of habit
<clever> it sounds more like it was once called UEFI, but then the old spec got renamed to EFI, and the new spec became the new UEFI
<clever> heat: or people who are just confused by the acronym soup :P
<clever> ovmf, edk2, efi, uefi!
<clever> did a cat step on my keyboard?
<heat> intel naming 101
<bslsk05> ​github.com: uefi-edk2/EdkModulePkg.fpd at svn/tags/InitialImport · grehan-freebsd/uefi-edk2 · GitHub
<clever> oh god, lol
<heat> it's something I found out about yesterday, so now you need to know as well
<clever> and something like say https://github.com/pftf/RPi3, its got edk2 as git submodules, i assume the build system lets you build a specific board implementation of uefi, and add your own code around edk2?
<bslsk05> ​pftf/RPi3 - Raspberry Pi 3 UEFI Firmware Images (24 forks/205 stargazers/NOASSERTION)
<clever> but wait, i dont see any actual source in that repo??
foudfou has joined #osdev
<bslsk05> ​github.com: edk2-platforms/Platform/RaspberryPi at master · tianocore/edk2-platforms · GitHub
<clever> aha, its upstreamed within platforms
foudfou has quit [Remote host closed the connection]
foudfou has joined #osdev
dh` has joined #osdev
<heat> EDK2 is stupid extensible
<heat> so https://github.com/heatd/tianocore/blob/master/edksetup.sh would set up a build that takes into account edk2 and edk2-platforms
<bslsk05> ​github.com: tianocore/edksetup.sh at master · heatd/tianocore · GitHub
<clever> aha, PACKAGES_PATH, that sounds a lot like what LK has
<bslsk05> ​github.com: Building Outside The LK Tree · littlekernel/lk Wiki · GitHub
<heat> yes but the build system is 10x more insane
<clever> i have poked at decompiling uefi firmware for one of my systems before
<clever> and it was litered with 100's of PE32 binaries
<clever> thats something LK cant really do easily
<clever> i assume all efi compatible firmwares are implemented like that?
<heat> yes
<heat> EFI flash images are just a standard filesystem-on-flash with PE images
<clever> a .efi that implements something like a fat32 driver, will have its entry-point called, it should register itself as an fs handler, and return from the entry-point?
<heat> everything is stupid modular
<heat> yes
<clever> and there would be some mechanism for discovering which .efi does that?
<heat> no, it loads everything
<clever> ah
<clever> so it just runs the entry-point for every single .efi in the flash, then something decides to start booting
<heat> define "start booting"
<clever> obeying config, and running either the CSM or normal efi boot procedure
<clever> where it either runs the MBR or looks at efi vars and loads a .efi from an ESP
<heat> sure, yes
<clever> that could even just be the last .efi in the load order?
<heat> no
<heat> for instance, when you're registering yourself (i.e a filesystem driver, in the DXE (driver execution) phase), you're not guaranteed to be connecting with the device/partition/whatever you support
<heat> you don't make that connection
<heat> BDS (boot device selection) does
<heat> this makes it so fast boot is possible
<heat> only connect what is required to boot
<heat> this is also how S3 resume works
<heat> connect and load what is required to boot
<clever> yeah, the fat32 driver just has to register its mount function to the type, and return
<heat> yes
<clever> and something else then decides to mount the ESP and load a .efi from there
<heat> yes
<clever> but what part is actually telling things to mount the ESP and execute the configured .efi binary on disk?
<heat> BDS
<clever> and is the BDS another .efi binary in the flash?
<heat> it's a phase
<heat> but probably
<clever> ah, so its more like it runs the entry-point for every .efi, and they can register to have a function ran upon starting some phase
<clever> once all .efi's are loaded, it progresses to the next stage, and goes thru a few
<heat> no
<heat> EFI boot is separated into SEC (security phase, not really used for security, commonly just has the reset vector), PEI (pre-efi initialization, does very early bringup, sets up RAM), DXE (driver execution, executes drivers), BDS (boot device selection, selects how boot is going to flow, what devices will get initialized, etc)
bradd has quit [Ping timeout: 244 seconds]
<heat> there's no "register to have a function ran upon starting some phase"
<clever> ah
foudfou_ has joined #osdev
foudfou has quit [Remote host closed the connection]
<clever> in the case of me re-porting things on the rpi, my inter-arch stuff would likely be at either SEC or PEI
<clever> and then i have to modify some drivers that DXE loads
<heat> ah wait, indeed there is in this case
<heat> it's a protocol you register in DXE
<clever> ahh
<clever> now its starting to make some sense, and kinda fits with how factorio mods work
<heat> that's scary
<clever> lol
bradd has joined #osdev
<bslsk05> ​github.com: heat-pipe-thermometer/src at master · cleverca22/heat-pipe-thermometer · GitHub
<heat> like SEC, PEI kinda go away (literally) when you switch to DXE
<clever> a factorio mod has 2 major stages, the first is the data.lua stage, where you must define every item, building, entity, recipe, and tech
<clever> that gets ran when the game starts, before you load any maps
<heat> there's also no dynamic linking so anything interesting inter-module is done with protocols or PPIs
<clever> and the data it outputs, gets converted into a tangled web of c++ classes, and the entire lua state is destroyed
<clever> so at that point, 95% of the game engine is setup, to act on whatever changes the mod has done
<clever> then when you load a map, control.lua is ran, and you can hook events like "script.on_event(defines.events.on_built_entity, on_ent_create)"
<heat> yeah
<clever> the bit where it diverges from efi, is the global var
bauen1 has joined #osdev
<clever> factorio will serialize that and store it into your save file
<clever> and deserialize it when loading a save
<clever> so a mod can put whatever state it wants in there, and it magically gets packaged up into the map save
<heat> uefi kinda does that lol
<heat> for S3
<clever> ah, yeah, lol
<clever> each mod has its own instance of global
<clever> and you can put references to ingame entities (buildings) in global
<clever> and the reference will remain valid after save+load
<clever> so, back to what i would need to do for re-porting uefi on the rpi
<bslsk05> ​github.com: lk-overlay/inter-arch.h at master · librerpi/lk-overlay · GitHub
<clever> heat: i have this 20 byte structure, with a 32bit magic# at the head, which must be 16 byte aligned, anywhere within a .bin file
<clever> on bootup, the previous stage will find that structure (by scanning for the aligned magic#) and then populate some of the fields
<bslsk05> ​github.com: lk-overlay/inter-arch.c at master · librerpi/lk-overlay · GitHub
<clever> i can then use this to both create the magic# in my .bin, and also read the fields out on startup
<heat> tip, just find a way to run EDK2 as a LK payload
<heat> if you infact kinda want that
<clever> aarch64 LK lacks an exec() routine
<clever> so there is no way for lk to then run edk2
<heat> writing that seems drastically easier than porting everything to UEFI
<clever> uefi has already been ported to the pi3 and pi4
<bslsk05> ​pftf/RPi4 - Raspberry Pi 4 UEFI Firmware Images (98 forks/854 stargazers/NOASSERTION)
<heat> the hip way of running UEFI is by using EDK2 as a payload
<heat> coreboot, slimbootloader do tha
<heat> t
<clever> yep, and i do name things payload in my code
<clever> but it works a tad differently
<bslsk05> ​github.com: lk-overlay/payload.S at master · librerpi/lk-overlay · GitHub
<clever> these 3 payloads get embeded into the *VPU* LK build
<clever> and on startup, it drops one of them at the arm reset vector, and sets the arm loose
<clever> so the payload is the very first thing the arm sees, upon running the reset vector
<heat> amd platforms keep their ARM firmware in the main flash image as well
<clever> there is no way to pass arguments to the payload via registers
<clever> hence, why i'm editing the payload, and using the inter-arch stuff above
<clever> the entire exec() step can be ignored, because the payload is the very first thing the arm touches
<clever> heat: so the problem then, is that i need a 20 byte structure to exist within the final .bin, that is 16 byte aligned, and can be read by some part of the efi code, PEI possibly?
hypoalgesia has quit [Quit: WeeChat 3.5]
<heat> yeah probably
<clever> hmm, and does edk2 usually have device-tree parsing support?
<heat> yes it does
<heat> it even does device-tree -> acpi
<clever> in my case, the DT is entirely custom, and just describes the bare minimum
<j`ey> I think my coworkers wrote that?
<clever> serial#, model#, framebuffer addr
<clever> the rest you can infer from the model#
<heat> j`ey, yeah
<heat> it's there for SBBR
<bslsk05> ​github.com: lk-overlay/arm.c at master · librerpi/lk-overlay · GitHub
<clever> heat: oh, and this code reminds me, does DT have any pre-existing routines, to copy/pasta a chunk of one DT into another DT?
<heat> that's a really sad DT
<clever> or am i better off just walking one DT and calling these functions on another
<heat> *shrug*
<clever> this DT is that simple, because the next stage is loading a proper .dts file from disk
<heat> look in libfdt
<bslsk05> ​github.com: lk-overlay/loader.c at master · librerpi/lk-overlay · GitHub
<clever> this code loads a dtb from disk, patches a few things, and copies the framebuffer/serial/model from the previous DT
<clever> dont see any recursive copy within fdt_rw.c
<clever> oh!, but overlays....
* clever reads fdt_overlay.c
k8yun__ has joined #osdev
<clever> that could work, if i just change the input dtb
k8yun_ has quit [Ping timeout: 245 seconds]
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
heat has quit [Remote host closed the connection]
foudfou_ has quit [Remote host closed the connection]
foudfou has joined #osdev
jafarlihi has joined #osdev
<jafarlihi> geist: Hey! I made my first Fuchsia CL but I wanted to ask if it's worth it to keep making more. It seems like they disappear into gerrit after a while and there are not even profiles to look into one's track record. Will Google notice if I keep making high quality CLs?
Vercas has quit [Quit: Ping timeout (120 seconds)]
Vercas has joined #osdev
k8yun__ has quit [Ping timeout: 245 seconds]
nyah has quit [Ping timeout: 245 seconds]
Vercas has quit [Ping timeout: 268 seconds]
foudfou has quit [Ping timeout: 268 seconds]
pretty_dumm_guy has quit [Ping timeout: 245 seconds]
pretty_dumm_guy has joined #osdev
elastic_dog has quit [Ping timeout: 272 seconds]
foudfou has joined #osdev