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
c2a2 has quit [Ping timeout: 268 seconds]
Burgundy has quit [Ping timeout: 248 seconds]
acidx has quit [Remote host closed the connection]
spikeheron has quit [Quit: WeeChat 3.7.1]
bradd has joined #osdev
gog has quit [Ping timeout: 248 seconds]
terminalpusher has quit [Remote host closed the connection]
nyah has quit [Quit: leaving]
kiri1606 has quit [Ping timeout: 252 seconds]
Celelibi has quit [Read error: Connection reset by peer]
gruetze_ has quit [Remote host closed the connection]
XgF has quit [Remote host closed the connection]
nikolar has quit [Ping timeout: 252 seconds]
XgF has joined #osdev
gruetzkopf has joined #osdev
spikeheron has joined #osdev
Celelibi has joined #osdev
nikolar has joined #osdev
<mrvn> When you do cmov then you have to compute both sides of the branch to store one value and then overwrite it conditionally with the other. If you branch and predict right then you only have to compute one branch.
<mrvn> Basically any work you do to get the value you cmov is wasted if you don't move.
<mrvn> zid: Ask them how they would turn that feature off when they don't want a bridge. Or how VPN should keep it's data secret if it gets dumped to eth0 automatically.
<mrvn> (tap0 / eth0 bridge question)
<nikolar> did the server just restart
<zid> whose server
<zid> oh the quits/joins?
<zid> looks like there was a broken link somewhere between two nodes and several people were caught in the crossfire
<zid> if an entire server dies, the other servers broadcast it as a netsplit
<zid> nodes being one of the servers and 'some router somewhere'
<zid> It only hit 5 people
<nikolar> yeah i was kicked out and had to login
craigo has joined #osdev
les has quit [Quit: Adios]
riverdc has quit [Ping timeout: 268 seconds]
riverdc has joined #osdev
eschaton_ has joined #osdev
eschaton has quit [Ping timeout: 248 seconds]
les has joined #osdev
elderK has joined #osdev
slidercrank has quit [Ping timeout: 252 seconds]
craigo has quit [Quit: Leaving]
craigo has joined #osdev
fedorafansuper has joined #osdev
fedorafan has quit [Ping timeout: 248 seconds]
fedorafan has joined #osdev
fedorafa_ has joined #osdev
fedorafansuper has quit [Ping timeout: 252 seconds]
[itchyjunk] has quit [Ping timeout: 260 seconds]
fedorafan has quit [Ping timeout: 248 seconds]
[itchyjunk] has joined #osdev
Arthuria has joined #osdev
ski has joined #osdev
slidercrank has joined #osdev
GeDaMo has joined #osdev
eponym has joined #osdev
epony has quit [Remote host closed the connection]
eponym has quit [Remote host closed the connection]
fedorafa_ has quit [Ping timeout: 248 seconds]
small has joined #osdev
fedorafan has joined #osdev
_xor has joined #osdev
gildasio1 has quit [Remote host closed the connection]
gildasio1 has joined #osdev
[itchyjunk] has quit [Remote host closed the connection]
slidercrank has quit [Ping timeout: 252 seconds]
small_ has joined #osdev
small__ has joined #osdev
small has quit [Read error: Connection reset by peer]
small_ has quit [Read error: Connection reset by peer]
<geist> ugh i think i'll give up on this gentoo install
<geist> it's too far gone
<geist> like 2 years of updates to do with tons of collisions
jstoker has quit [Read error: Connection reset by peer]
ilovethinking has joined #osdev
<ilovethinking> hey, what does it take for IRQ1 to fire? i can't find anything about it on the wiki, and my IRQ1 handler never gets triggered
jstoker has joined #osdev
<geist> i assume you're on an x86 pc? IRQ1 is the keyboard one
<geist> so you'd need a keyboard, set up the PIC to let the irq through, and generate a keycode
<geist> not sure what granularity you are looking for
<kazinsal> make sure the IRQ isn't masked, make sure there's no EOI needed still pending, pres butan, receive interrupt
<geist> also have to configure the PIC to map it to one of the x86 vectors you expect (ie, 0x21)
<geist> but yeah press butan receive cookie
<GeDaMo> "Keyboard not found. Press F1 to continue" :|
<ilovethinking> geist: well all i do is lock my mouse in qemu and press a key and it doesnt work
<geist> okay, soooo did you configure the PIC, etc etc?
<geist> there's like 5 or 6 things you have to do, did you do any of them?
<mrvn> and configure the PS/2 controler
<ilovethinking> well all i do is remap the pic lol
<mrvn> you should start just polling the keyboard.
<ilovethinking> and added a handler for irq1
<ilovethinking> mrvn: what the fuck no
<geist> did you unmask the irq?
<geist> and enable irqs on the cpu?
<mrvn> ilovethinking: it's hard to debug IRQ1 problems if you don't even know if your keyboard works.
<geist> also a little hard for us to help us if you dont tell is what you have done until we have to keep probing
<bslsk05> ​github.com: cuteOS/handlers.c at main · thinkorsinkk/cuteOS · GitHub
<ilovethinking> ok so i need to unmask the irq
<ilovethinking> gotcha
<geist> probably, yes
<mrvn> and as said configure the keyboard controller and poll it to see if it works
<kazinsal> you're also never acking any IRQs it looks like
<kazinsal> so what's likely happening is the PIT is firing IRQ0
<kazinsal> and the PIC is never getting acked
<kazinsal> so IRQ1 never raises INTR#
<mrvn> kazinsal: wouldn't fire when 0 is masked?
<mrvn> +that
<kazinsal> looks like the masks are being saved from how the firmware initialized them
<kazinsal> so likely fully unmasked
<mrvn> don't forget to enabled irqs in the cpu too
<kazinsal> that too
Left_Turn has joined #osdev
<ilovethinking> so i should
<ilovethinking> mov al,20h
<ilovethinking> out 20h,al
<ilovethinking> in the handler?
Turn_Left has quit [Ping timeout: 246 seconds]
<geist> i dunno, tell me what that's supposed to do?
<bslsk05> ​wiki.osdev.org: Interrupts - OSDev Wiki
<ilovethinking> "from the os perspective" section
<ilovethinking> it says that acknowledges the interrupt
<geist> okay, so did you try it?
ilovethinking has quit [Remote host closed the connection]
xenos1984 has quit [Ping timeout: 252 seconds]
xenos1984 has joined #osdev
elderK has quit [Quit: Connection closed for inactivity]
small has joined #osdev
xenos1984 has quit [Ping timeout: 248 seconds]
small__ has quit [Read error: Connection reset by peer]
xenos1984 has joined #osdev
levitating has quit [Ping timeout: 268 seconds]
levitating has joined #osdev
small has quit [Quit: Konversation terminated!]
danilogondolfo has joined #osdev
bnchs has quit [Remote host closed the connection]
Affliction is now known as Guest8187
Affliction has joined #osdev
Guest8187 has quit [Ping timeout: 268 seconds]
gog has joined #osdev
spikeheron has quit [Quit: WeeChat 3.7.1]
wootehfoot has joined #osdev
scaleww has joined #osdev
scaleww has quit [Quit: Leaving]
sinvet__ has joined #osdev
Arthuria has quit [Remote host closed the connection]
ilovethinking has joined #osdev
<ilovethinking> where can i find out more about IRQs? the osdev wiki is very bad
<Mutabah> various tutorials?
<ilovethinking> hmm i haven't used one yet, which ones can you recommend?
<Mutabah> Phil-Opp's rust one is pretty good
<Mutabah> Short summary: IRQs are signals to the CPU that something needs immediate attention
<Mutabah> How they're delivered can be really complex, depending on the architecture
<ilovethinking> yes I know, but I don't know how to make them actually work, once I came here I found out I have to enable them in the CPU, unmask them, etc etc
<ilovethinking> I'm probably doing them too late, I have virtual & physical memory done already
<Mutabah> There's a LOT of legacy around, unfortunately. And modern systems also have complex interrupt routing (to handle multiple processors sharing interrupt load)
danilogondolfo has quit [Remote host closed the connection]
<ilovethinking> mmmmm well
<ilovethinking> I have to go now
<ilovethinking> but i'll probably look at the tutorial and also the sdm, forgot about that lol
<ilovethinking> see ya
<Mutabah> It's not just the CPU's SDM
<Mutabah> it's the APIC (local and IO)
ilovethinking has quit [Remote host closed the connection]
Arthuria has joined #osdev
ilovethinking has joined #osdev
<ilovethinking> Mutabah: i don't have the APIC/IOAPIC set up
<ilovethinking> i use the default 8259 one
<ilovethinking> for now
ilovethinking has quit [Remote host closed the connection]
wand has quit [Remote host closed the connection]
wand has joined #osdev
sinvet__ has quit [Remote host closed the connection]
Turn_Left has joined #osdev
Left_Turn has quit [Ping timeout: 252 seconds]
selve has quit [Remote host closed the connection]
selve has joined #osdev
epony has joined #osdev
selve has quit [Remote host closed the connection]
selve has joined #osdev
gildasio1 has quit [Ping timeout: 255 seconds]
gildasio1 has joined #osdev
nyah has joined #osdev
[itchyjunk] has joined #osdev
slidercrank has joined #osdev
<netbsduser`> anyone have any good resources on practical, existing implementations of the working set model and balance set maintenance?
FreeFull has joined #osdev
tanto has quit [Quit: Adios]
pie_ has quit []
vancz has quit []
<netbsduser`> the main thing i am referring to is my copy of Windows Internals but it would be nice to have a second source
tanto has joined #osdev
pie_ has joined #osdev
vancz has joined #osdev
<sortie> netbsduser`, oh good question, I used Tanenbaum's Modern Operating Systems back in University, it probably has such information
<netbsduser`> sortie: i liked that book, tanenbaum seemed to avoid the habit of my lecturers (who discussed wanton and outrageous ideas, like true-LRU lists updated on every access, or capacitors associated with pages which were charged on each access and whose residual charge was input to the page replacement policy)
<sortie> Yeah I do dislike a bit when too much time is spent on ways of doing things that operating systems don't actually do
<netbsduser`> i have it here, he has a few pages of fairly abstract chat about working sets and WSClock. ideally i am looking for discussions of concrete implementations, so i can check my own plans against them to see if i'm about to make any mistake they already figured out
<netbsduser`> sortie: i do think it was useful to cover when i was in uni, but in my case the lecturers hardly drew a distinction between these idealised approaches and actually-existing approaches, and we built simulations mostly of the abstract models
<netbsduser`> it was useful background information for me, but when i set about actually implementing page replacement and swapping in my kernel some weeks ago, the practicalities of it were daunting, it was to 4.4BSD/Mach i had to turn, and a friend who is quite obsessed with this stuff, so that i could figure out how to do it efficiently, how you deal with problems like the fact that a global page replacement daemon has to lock in the opposite direction to a
<netbsduser`> page fault handler
tanto has quit [Quit: Adios]
pie_ has quit []
vancz has quit []
tanto has joined #osdev
pie_ has joined #osdev
vancz has joined #osdev
wootehfoot has quit [Quit: Leaving]
tanto has quit [Quit: Adios]
pie_ has quit []
vancz has quit []
tanto has joined #osdev
pie_ has joined #osdev
vancz has joined #osdev
sham1 is now known as sham1|away
xenos1984 has quit [Read error: Connection reset by peer]
sham1|away is now known as sham1
fedorafan has quit [Ping timeout: 248 seconds]
fedorafan has joined #osdev
_xor has quit [Quit: brb]
xenos1984 has joined #osdev
<mrvn> netbsduser`: If you just replace random pages you are half as good as the imaginary strategy to replace the page you don't need the longest. Many ideas don't even beat that.
<mrvn> and think about the cost: no LRU needed, no A bit interrupts or no scanning page tables for A bits and clearing them, ...
Left_Turn has joined #osdev
Turn_Left has quit [Ping timeout: 252 seconds]
MrPortmaster has joined #osdev
MrPortmaster has quit [Client Quit]
<netbsduser`> mrvn: it's not the worst approach, and i don't really like my current global approach
<netbsduser`> i've hatched a plot to move to a local algorithm which is initially very simplistic, the principle is that processes are allocated a number of pages they can have in-memory, this dynamically grows or shrinks according to conditions, and if it can't grow under current conditions, the least recently mapped page is unmapped and replaced with the new one, simple fifo
<mrvn> The part I always struggle with is shared/COW pages. How do you way that? It's better to swap out a page that only one process uses over a page shared by 100, right?
<mrvn> netbsduser`: fifo goes from working really great to absolutely horrible when your working set equals your ram.
<netbsduser`> to provide a second chance, the pages get pushed out to a queue when they're no longer mapped anywhere, where they are lazily written to disk (if dirty) and placed on a queue of pages, that queue is where new page allocations come from if there's none free
<mrvn> or in your case the allowed number of pages for the process
<netbsduser`> so this makes a very rough approximation of LRU, you will still have more page faults than you want, but at least they won't need to do I/O unless you waited so long that the page reached the head of its queue and was reused
<mrvn> You will also always swap out essential pages that are accessed all the time for pages you rarely use.
<netbsduser`> mrvn: yeah, without ensuring that the second-chance mechanism is maintaining a good number of pages on the laundered-and-ready-for-reuse queue, it would be completely unsuitable
<netbsduser`> and at least in the long term something like WSClock is preferable because then you eliminate the regular 'soft' page faults that would occur (page is unmapped, but still in-memory on ready-for-reuse queue)
<mrvn> You still suffer from a problem I believe linux does too. Your queue can only prioritize pages that are still in ram. As your working set grows you will swap out important pages and swap them right back and never notice it's always this small set of pages spending so little time on disk.
<mrvn> You should be counting how frequent a page is swapped in and replace them less often.
<mrvn> By the way: Why do you unmap pages you put in the queue?
<netbsduser`> it's rather that the page has to have been unmapped from every process before it goes into the queue
<mrvn> why?
<mrvn> If you stop doing that then you can just have all pages in the queue and you have a true LRU.
<mrvn> You can unmap pages that read the head of the queue.
<mrvn> reach
<netbsduser`> i am hoping to implement a primarily local page replacement policy, with the global level (the lazy write to disk and reuse) not having to care about doing unwieldly things like locking all address spaces where the page is mapped, unmapping it, and then issuing a TLB shootdown
<mrvn> But you still have to do all those things, just earlier and (hopefully) often unecessecary.
<netbsduser`> with the purely global approach, it requires a lock order inversion (lock page -> lock its owning object -> lock every address space it's mapped in), and i have to use unseemly hacks to allow page fault handlers (which lock in the opposite order) and suchlike to detect the condition and bail out
<mrvn> I don't see how doing it locally changes the inversion
<netbsduser`> because in this case the local replacement is done within the page fault handler; or in situations of global low memory, a flag is set which causes all page faults in service which want to do an allocation to give up and wait on the "memory pressure reduced, please resume" event
<mrvn> So process A faults, you run out of pages, you remove the page locally, you lock the page, you lock its owning object, you lock every address space it's mapped in, you unmap, yout shoot it down, you move it to the queue. Same inversion.
<netbsduser`> mrvn: if we have run low on pages globally, the page fault handler sees this when it tries to allocate a new page and bails out to wait on an event. but if we have simply ran out of space in our working set list, we unmap that page from this process exclusively and possibly TLB shootdown if the process has other threads running
<mrvn> netbsduser`: so the page you shoot down locally doesn't get shot down everywhere else? But then you don't get any shared pages free from the shootdown. Don't you simply run out of pages then or only swap non-shared pages?
<mrvn> I immediately see a local DOS problem there. Fork 1000 processes and setup shared memory. 999 processes map 100 pages each and goes to sleep. The last maps those 99900 pages and will never have them swapped out to disk.
<netbsduser`> mrvn: this is where we have to do something which i hope won't happen too often in practice, namely it wakes a kernel thread that then iterates processes, starting with those of lowest priority, and trims pages from their working set list, and proceeds until a satisfactory number of pages have been freed
<netbsduser`> hopefully the administrator has made sure that the untrustworthy user's profile was configured to impose low priority on her processes, which should mean those processes are preferentially trimmed
<netbsduser`> we could also imagine setting limits on the total working set list size of all processes of that user
<mrvn> netbsduser`: assuming processes do fault regularly each processes working set list should grow/shrink naturally in the fault handler. You would only do a sweep to catch sleeping processes.
<mrvn> The DOS processes working set list would still be just 100. It's mapped pages would go out of that list and get unmapped. But they never get added to the queue because the other processes still hold them in memory. They are stuck between being mapped and queue.
<netbsduser`> this is where policies to balance the maximum sum of working set list sizes for processes by user would have to come in
<netbsduser`> DOS user can play their dirty tricks, but hurt primarily themselves. implementing the policy well is more easily said than done, of course...
<mrvn> yeah, giving each user a cgroup for example and giving each cgroup the same number of pages would solve that problem. Each user would only play tricks on themself then.
<mrvn> Something I think is far more important in a multi user environment than anything else. Just because one user is swapping like mad should not affect the other 100 users that only want to read their mail.
<netbsduser`> this is something i'm quite keen on, and something i think made easier by this local approach
<mrvn> When I thought about swapping for my kernel my idea was to split the memory in half. 50% of memory gets distributed equally to al processes (up to what each process has mapped). The other 50% are assigned dynamically with some replacement strategy.
<netbsduser`> i have had bitter experiences on linux where things get unusable during heavy swapping. i was testing some code and accidentally allocated memory in an infinite loop; i never saw anything so wanton and ghastly, it was a mess, terrible
<mrvn> So no matter how much you swap other processes with small working set aren't affected. They may sleep for an hour, wake up and still have their core memory there.
<netbsduser`> desktop was no longer responsive at all, it did not timeously switch to another virtual terminal, i tried to login by SSH to terminate the offending process, login took 2 minutes, typing one character took 10s or so. in the end the OOM killer terminated my rogue process when it exhausted the swap space
<mrvn> when you have to swap in heavily under linux your system is basically dead.
<mrvn> your mouse pointer will start to freeze up because the code moving the pointer gets swapped out.
<netbsduser`> mrvn: this sounds like a reasonable approach, i do wonder whether it's more appropriate to clear out processes that have been sleeping for a long time though
<mrvn> depends on "Long" I guess. Certainly not something sleeping 1s.
<mrvn> You can dynamically tune that 50% split. But I think a process should always have some of it's memory mapped. I want processes to sleep and not get penalized for it.
<mrvn> My feeling is that you have 16GB of ram. When a process needs more than 8GB and is swapping then adding 1 more GB to the working set rarely makes any difference.
<mrvn> there is a very small band where 8GB is swapping but 9GB will not.
<netbsduser`> there can be a bit of room for processes to give advice, perhaps
<netbsduser`> suppose i am crond, i can determine i'm not going to wake up until such-and-such a time, and advise the kernel, "you might as well swap me out, that's an hour away and the delay won't make a meaningful difference"
<mrvn> What's worse in linux is that any run-away process allocating like mad will just trash the whole system until swap is full. Only then OOM killer starts and probably kills a few other processes first because the BAD one is so active it clearly must be important.
<mrvn> s/swap me out/reduce the mapped working set/ and you have an idea.
<netbsduser`> oh yeah, it's a real nightmare
<netbsduser`> and it's not as though you can set a reasonable policy like not permitting to commit too much memory
<mrvn> I do. I have no swap.
<netbsduser`> i'm looking at top right now, i have a whole suite of chromium processes which have allocated 133g of virtual address space for some reason
<mrvn> address space is cheap. How much of that is used?
<netbsduser`> i think on windows you're banned from allocating zero-on-demand virtual address space unless it fits within system memory + the pagefile
<mrvn> configurable on linux.
<netbsduser`> at least this is what i have been told. oh, just 177m for almost all of them
<mrvn> On windows the page file grows as needed
<netbsduser`> i have had slightly better times on windows with heavy swapping than i have on linux which is what makes me wonder what its secret is
<netbsduser`> hopefully i find my answer in this copy of Windows Internals i just bought
<mrvn> In like the last decade or so the only thing ever that swaped are: 1) buggy programm allocating too much, 2) web browser.
<mrvn> So really, I'm fine with simply killing both of those.
FreeFull has quit [Remote host closed the connection]
samis is now known as CompanionCube
<netbsduser`> i have 745m in my swap partition apparently (plus 4.4g in my zram)
<netbsduser`> i think i'd like to do zram for my kernel
<mrvn> One feature I want to implement in my kernel is an event system for memory pressure. Processes should report how much of their memory they could release if needed, maybe with several levels for difficulty/importance. And when the kernel runs low on memory it would tell processes to release some voluntarily.
<mrvn> So when the kernel runs out of memory instead of killing firefox it would tell it to drop the caching for some unseen tabs, reduce the pre-rendered framebuffers that make swapping tabs and scrolling fast etc.
<netbsduser`> i read about that in XNU, and i think Serenity OS does part of it (they don't have kevent() with its EVFILT_VM for sending notifications, but i think they do have a feature where a process can say, "this memory is cache, you can dump it in situations of memory pressure")
<mrvn> yeah, but then what happens on access? page fault and the process has to then catch that, see it was cache and recreate the data?
<netbsduser`> i think (this might be confabulated) it must have some sort of critical section you enter when accessing the cache, and the entry call must allow a "this cache was deleted" return value
<mrvn> Another idea is to have a kernel cache daemon where you can store data and ask for it back. That way all cache memory is in one place and the kernel can determine what to keep and what to throw away easily.
<mrvn> But both ways just work for pure read caches. Maybe I want a write cache. For example gimp working on a huge image. As long as there is ram all changes should be made in ram. But when ram gets low the image needs to be saved to disk and not just dumped.
<mrvn> Or you compress tiles and free up 90% of the memory. That's a form of caching too.
<clever> memcached can kinda do that, but its in userland, and you just configure how much it should use
<clever> in the past, ive used it with php, both to store the php bytecode cache, and for storing sql responses
_73 has joined #osdev
bnchs has joined #osdev
Arthuria has quit [Remote host closed the connection]
scaleww has joined #osdev
epony has quit [K-Lined]
fedorafan has quit [Ping timeout: 248 seconds]
wootehfoot has joined #osdev
fedorafan has joined #osdev
wootehfoot has quit [Max SendQ exceeded]
wootehfoot has joined #osdev
scaleww has quit [Quit: Leaving]
Arthuria has joined #osdev
<yuriko> I think Mac OS 9 did that and that resulted in applications grabbing up all the RAM they could so they're not the one being caught with the out of memory error.
<mrvn> but then they are just getting asked to give it back.
<mrvn> The problem this should solve is stuff getting swapped out that would be easier to recreate than read from disk.
* geist yawns
<geist> hellow fronds
<zid> I don't think geist liked your story yuriko :P
<nikolar> Heblo
<yuriko> aww
<geist> awww hi yuriko
<yuriko> hii
<yuriko> I just recently joined here because I'm making and OS in Rust, just by following a guide, since I'm a novice
<sham1> Good $TIME_OF_DAY
<zid> You should talk to heat, he loves rus- You should talk to Mutabah.
<bslsk05> ​github.com: thepowersgang (John Hodge (Mutabah)) · GitHub
<zid> that's his github
<geist> oh cool, yeah Mutabah seems to have gotten the farthest along in the rust-kernel department around here
<yuriko> I'll keep that in mind, thx
<zid> If you can grok C syntax or have pure architecture questions though the rust of us will do just fine
<yuriko> the rust of us
<zid> Oh no, the infection... it's spreading..
<sham1> It is a fungus after all
<zid> /nick zidoxide
<netbsduser`> sham1: this explanation from the rust developers i found amusing
<geist> the RESF strikes
<sham1> It'd be a bad strike force if it didn't strike
<geist> no one expects the RESF
<netbsduser`> "no, we didn't name it after the product of the corrosion of iron, we named it after the fungus that blights crops and menaces millions with famine"
<geist> hides in your closet, on top of the refrigerator, under your car. strikes at any time
<sham1> [netbsduser](https://matrix.to/#/@netbsduser:libera.chat): yeah, and add to that the fact that a lot of the tooling and such in Rust is named after metal and oxidation puns and that explanation falls flat
<bslsk05> ​matrix.to: You're invited to talk on Matrix
<sham1> What the hell happened
<netbsduser`> i am not in the matrix, i am very real
<sham1> Apparently not. The bridge didn't know how to handle the backtick
<netbsduser`> but aye, i think they should just own the fact that it's clearly named after iron oxide
* kof123 waits for deja vu gog to walk by
* sham1 squints at the link
<yuriko> I thought it was named after iron oxide because it's close to the metal
<sham1> They should really be percent-encoding that
<yuriko> my question is when are they going to make just a matrix:// uri instead of the matrix.to thing
<sham1> The code block backtick shouldn't cross the markdown link syntax. Absolute amateur hour
<yuriko> depends on which of the 2000 versions of markdown you use
<sham1> CommonMark. And if the codeblocks can interrupt link tags in CommonMark then that's just bad as well
Arthuria has quit [Remote host closed the connection]
<sham1> Anyway yeah, a lot of us here most likely aren't all that fluent in Rust so any Rust-specific OSDev questions might be a hit or miss
<gog> ???
<gog> i don't know rust
<zid> No no gog, rust you're familiar with, it's *trees* that you don't know
<zid> easy mistake to make
<gog> true
<gog> i haven't seen a tree in 3 years
<gog> i don't even remember what they look like
<gog> you could show me a tree and i'd be like that's a fucken dog wtf
<zid> They grow down from the root node and have leaves which are integers, I think
<gog> pointers
<gog> pointers to pointers
* FireFly points at gog
* gog dereferences FireFly
* FireFly disappears in a puff of smoke
<zid> what is the value of gog?
<zid> we know the value of FireFly's gog's address
<gog> i make good pasta, that's my value
<FireFly> gog's invaluable
<zid> so you're a function?
<geist> do you have a mutable reference to gog?
<zid> #define gog(x) pasta_new(x)
<geist> if so you can borrow gog
<gog> all references are mutable unless qualifed const
<gog> i am not memory safe
<geist> unsafe { gog }
<gog> i feel very unsafe rn
* geist puts gog in a std::Box<gog>
* gog prrr
<sham1> The gog box
heat has joined #osdev
wootehfoot has quit [Quit: Leaving]
<geist> gogs like boxes
<gog> they make me feel camouflaged
<gog> encapsulated
<heat> sup
<gog> heat: boxzinga
<heat> gox
<sham1> Now, are you immutable?
<gog> i'm very mutable
<gog> i should be working on keyboard input
<heat> no
<gog> ok
<geist> aww you just totally killed the scene
<zid> I should write a vmware graphics output
<zid> heat tell me how
<gog> sorry
<geist> naw heat did. showed up to an improv scene and said 'no'
<gog> ah yes
<geist> remember you aways say 'yes, and ...'
<gog> yes, and
<heat> no, and no
<zid> no he killed the entire osdev scene
<zid> dead
<gog> i dpn't know how to write 2d graphics
<zid> pack up and go home
<gog> i did it anyway
<heat> the only thing I can't kill is kalameet
<gog> doing things you don't know is how you learn
<geist> also eating braiiiiins
<clever> thats how i wrote a 3d engine from scratch, without knowing any of the norms
<gog> braaiinnns
<clever> i just grabbed some pop cans, a tape measure, and brute-forced the formulas for perspective
<heat> zid, what do you want from the vmware device?
<zid> fbcon
<zid> is fine
<gog> i should learn how to use virtio-gpu
<bslsk05> ​github.com: Onyx/kernel/drivers/svga at master · heatd/Onyx · GitHub
ilovethinking has joined #osdev
<heat> I have modeset code there that works, plus some not-working-3d-stuff
<gog> zid write your own fbcon
<zid> like, in vhdl?
<gog> yes
<gog> but also in software
<geist> the bochs vga device is also worth having a driver for if you havent already
<gog> is that what qemu uses
<geist> simple ass vga + some ability to resize the screen, etc
<heat> by default yes
<heat> but bochs kinda sucks
<zid> I have the bochs vga yes
<zid> qemu and bochs use it
<gog> hm
<zid> I need something diff for vmware
<zid> afaik
<gog> wait that means i can do the bochs vga accel
<heat> no
<gog> no??
<heat> bochs vga has no accel
<zid> bochs vga has double buffering
<gog> yeah that's what i mean
<geist> i dont think the bochs vga has any blit stuff. it's more of simple vga + some ability to query/set things that real vga doesn't have
<gog> hardware double buffer
<zid> I need to test what happens on overflow wrt the scroll
<zid> if it wraps you could use it for hw scrolling
<zid> instead of double boofering
* gog scrolls around
* sham1 surfs about
* geist digs a hole to Albuquerque
* kof123 draws physics equation on napkin to plan how to swing baseball bat while foghorn looks puzzled
<kof123> noone's gonna get that geist :D
<zid> btw for those not paying attention, series 2 of clarkson's farm is out
<gog> loony tunes
<zid> so you should all be too busy to be ircing
<gog> i'm eating pasta
<gog> too busy to watch tv
<geist> Yah I can still toss it out and see who does though heh
<gog> i might need to lay down after pasta
<gog> it was too much
<ilovethinking> geist: first person who spelt albuquerque correctly
<geist> suggestion: lay on an inclined plane. dont let it push against your esophagal sphincter
<geist> ilovethinking: achievement unlocked!
<gog> sometimes ill be quiry.... ill be quirky... ALBUQUERQUE! they're moving the isotopes!
<ilovethinking> indeed
<ilovethinking> (i still can't set up irq1)
<geist> thats' cause you're going at it all wrong
<ilovethinking> where do i read up on it
<geist> you need to sit down and do a bit o' learning first, instead f trying to cobble thing together without an understanding
<ilovethinking> sdm?
<geist> sdm for the intel side stuff yes. for the PIC i think the osdev wiki is pretty much what yo uneed
m3a has joined #osdev
<gog> speaking of irq1 does anybody have a link to a datasheet
<geist> and then for enabling the ps2 there should be enough tutorials, etc around
<gog> the one on the wiki is dead
<gog> and google is worthless
<ilovethinking> geist: osdev wiki is so shit it does't tell me anything
<geist> hmm, datasheet to what?
<zid> There's a really good PIC document
<zid> if that's what you want
<gog> for the i8042
<zid> what's an i8042
<gog> i have the pic one
<geist> ah. hmm
<gog> PS/2 controller
<geist> ilovethinking: well, being a bit more specific might help
<zid> http://www.brokenthorn.com/Resources/OSDevPic.html is the good shit for PIC at least
<bslsk05> ​www.brokenthorn.com: Operating Systems Development Series
<zid> that's how you set up IRQs
<geist> also a fair amout of us have contributed to the wiki, so might be a little nicer to not be as harsh
<zid> nah the wiki is bad
<zid> like, objectively
<zid> good resource collection though at the bottom of the pages
<geist> alright. well anyway, if you have specific questions we might be able to help
<ilovethinking> geist: wdym?
<zid> [20:06] <ilovethinking> geist: osdev wiki is so shit
<gog> the forum has a decent step-by-step on how to properly reinit the PS/2 controller but it doesn't have values for the bits i need to send
<mrvn> zid: it's the shit
<heat> zid, broken thorn sucks
<zid> sounds it
<ilovethinking> zid: and?
<sham1> "Why doesn't the wiki just give me all the code I need"
<heat> gog, yeah that guide is also borken
<geist> look, none of these have exactly what you want so what you need to do is try to figure out what you dont know
<geist> and then you'll have a framework to start seeking the answers you wnt
<bslsk05> ​www-ug.eecg.toronto.edu: The PS/2 Keyboard Interface
<heat> gog, my code work well yes?
<zid> ilovethinking: I was answering a direct question for you
<geist> ie, understand the steps you'll need to do and then you can start to drill into them
<bslsk05> ​github.com: Onyx/kernel/drivers/ps2 at master · heatd/Onyx · GitHub
<zid> more of this "it's shit" "and?" crap and I'm going to get upset
<gog> hmm
<ilovethinking> sham1: "why can't i start reading past messages in irc for context"
<gog> yes this will work i think
<gog> thank you mr heat
<heat> no problem señora gog
<zid> my link is good too I think :(
<geist> right, also pointers to existing code that a bunch of us have written may help
<geist> but we need to understand where you're stuck first
<gog> actually imeant mr zid
<zid> oh phew
<sham1> ilovethinking: being inflammatory doesn't exactly give the best first impression, but fair enough
<zid> heat you suck
<heat> thanks
<gog> no he doesn't
<zid> heat you're bad in bed
<ilovethinking> sham1: sorry but i genuinely just don't know where to start with irq1
<geist> well, you kinda do though
roan has joined #osdev
<geist> because just last night you were saying 'oh i've already configured the PIC to do this and that'
<zid> heat: Oh, that link is broken thorn!
<zid> I just figured it out, I thought it was some rare dark souls weapon
<geist> so that actually gives us some context as to what you do and dont know
<gog> make sure your idt is correctly set up, make sure your (ioa)pic is correctly set up
fedorafan has quit [Ping timeout: 252 seconds]
<gog> then the ps/2 controller
<geist> ilovethinking: see the problem is you're not giving us enough context. what do you and dont know, what steps you've already taken, etc
<geist> 'i dont know how to do tis' is not going to get a good response
<geist> because we dont know what you know
<ilovethinking> geist: https://github.com/thinkorsinkk/cuteos i have trap stubs set up for my idt, loaded it, have a handler for IRQ1, cleared IRQ1 mask, remapped pic
<bslsk05> ​thinkorsinkk/cuteOS - vewy cute os uwu (0 forks/0 stargazers/GPL-3.0)
<geist> do you know if your irq handlers work at all?
<zid> so you're well beyond not having the first idea the
<gog> uwu
<geist> or is this your first one?
<ilovethinking> first one
<geist> zid: exactly my point. they keep saying 'i'm totally lost' and then point at a pretty large chunk of code that shows they're not
<zid> which things work? which things don't work?
<zid> what behavior do you expect? what behavior do you get?
<geist> okay, so since it's the first irq you've tried firing, we can make not assumptions that anything else works
<geist> so suggestin: use an 'int' instruction to manually trigger it
<geist> and then debug the IRQ handler code, which is probably broken
<geist> make sure your IDT is working, make sure the irq handler works and can at least print something or whatnot
<geist> then once you have that under control start worrying about the PIC and then configure the ps2 controller
<geist> as mrvn was pointing out last night, another thing to debug the ps2 is poll on it, so you can figure out how that cotroller works
<geist> if it's reading keycodes, etc
<geist> once you have that working you can then glue the two ends together, so there are less variables in flight
<geist> right now there are like 5 things that can be broken and it's hard to debug it, so you need to divide and conquer the problem into smaller steps
fedorafan has joined #osdev
<Amorphia> not enough context> I have to tell my junior colleagues this fucking constnatly
<zid> It's sort of a catch-22
<heat> worth noting that the ps2 controller stuff sucks hard
<zid> if they were smart enough to be able to explain their problem, they'd be smart enough to fix it themselves, most of the time
<heat> it's very undocumented and bespoke
<Amorphia> zid: hahaha
<Amorphia> indeed
<sham1> They'd basically be rubber-duckying it
<geist> zid: yah and sometimes getting them to try to descerie it is half the solution, because it forces them to try to think more clearly about it
<Amorphia> geist: yup
<geist> ilovethinking: are you still there?
<geist> last night you did the same thing, we gave you a bunch of feedback and then you dissapeared
<Amorphia> maybe they're watching the superbowl
<geist> superb owl!
<zid> I like watching owls
<Amorphia> :D
<Amorphia> owls are cute :>
<ilovethinking> geist: new to irc, hate that it disconnects often
<ilovethinking> and if i lock my screen it disconnects
<geist> ah, it's not showing disconnects here. are you using some sort of caching web thing?
<ilovethinking> i'm using limechat on mac
<zid> you're not disconnecting
<geist> odd. well FWIW it's not showing you disconnecting here
<ilovethinking> i didn't disconnect now
<ilovethinking> but last night
<geist> oh sure
<zid> yes, this is realtime chat, we were asking if you were still here now
<zid> as you hadn't responded to anybody (geist mainly) about anything
<ilovethinking> geist: the thing is, i don't think i have irqs set up properly
<AmyMalik> dubber rucky
<ilovethinking> zid: was talking to my sister
<geist> ilovethinking: more clarity. what do you mean precisely by that?
<zid> apparently because you never read it
<heat> why is everyone so chaotic tonight
<geist> heat: SUPERRRRRBOOOOWL
<zid> heat: Neutral is overrated
<AmyMalik> chaos is tasty
<zid> chaotic evil best
<sham1> geist: sorry, drank some chaos juice before
* Amorphia is chaotic good
<sham1> (Non-alcoholic)
<ilovethinking> geist: someone (you?) said i need to enable irqs on the cpu
<ilovethinking> and i shit you not i've been everywhere and it says nothing about it
<geist> that's the SDM
<gog> yes
<geist> which really you should read, but i know it's a big task
<heat> zid, a bunch of chaos-servant-shortcut-loving people here
<Amorphia> what's a SDM
<sham1> Also, as one should remember, chaos is a ladder
<geist> but again, 'setting up interrupts' can mean a lot of things. specifically i'm saying 'lets start by making sure your IDT works'
<gog> there's a register that has flags and one of the flags enables/disables external interrupts
<gog> Amorphia: the intel software developer manual
<geist> and in that case, forget PIC forget PS2. lets focus on the cpu itself
<gog> or amd
<Amorphia> gog: oh that
<Amorphia> i used to have the physical ones for x86
<gog> i prefer the amd for a quick reference
<gog> and intel for a detailed reference
<Amorphia> all 8 volumes
<gog> lmao wow
<sham1> I prefer AMD's manuals for AMD64. It's their architecture after all
<zid> I have the physical amd64 and physical x86
<gog> it wss a lot back then
<sham1> RIP Itanium
<gog> it's a lot now too
<zid> but vole 1-3 only
<Amorphia> idk if they still do it but back in the day intel would send you the manuals for free
<Amorphia> fat box of them
<geist> theyd ont, but yeah it was nice
<Amorphia> so i ordered to my mother's house lol
<geist> AMD straight up sent me their AMD64 ones out of the blue
<Amorphia> maybe she still has them even, IDK
<geist> because i was a hobbyist osdever. they must have kept a list
<zid> it was just 'free' then 'free but we only do it every 3 years' then 'we don't do it'
<geist> honestly that really put them in my good graces ever since
<Amorphia> zid: aw
<Amorphia> geist: nice
<zid> I think my manuals are from like.. 2012
<ilovethinking> geist: yes, i asked before about reading up on it on the sdm and someone said it's not worth it
<gog> amd has been consistently a better value for most of the last 20 years
<ilovethinking> my idt is functioning perfectly
<geist> ilovethinking: how do you know your idt is functioning properly?
<gog> except like a short period where intel was edging them out
<heat> it's not worth it to read front-to-back
<zid> (That implies you tested it, so tell him which tests you did and what results you got)
<ilovethinking> geist: ihave handlers for gp, pf, df and they all work
<heat> because it's thousands of pages long
<sham1> heat: Sure it is. It's a good sleeping aid
<geist> they fire, do stuff, and return?
<gog> or do they halt
<ilovethinking> they fire, tell me the value of ip and halt
<gog> returning is a little trickier because sometimes you need to unwind a byte from the stack frame
<gog> sometimes you don't
<geist> perfect. so what x86 vector do you want IRQ1 to map to?
<sham1> Holy hell, tomorrow it'll be up to 7°C here
<ilovethinking> 0x21
<geist> good good. so you have a handler at that slot currently?
<ilovethinking> yes
<geist> and the lidt has the correct length to at least cover that?
<ilovethinking> yes
<geist> good. so a thing to try: `int 0x21`
<geist> see if you can just fire it manually
<geist> (should work, but would just make sure this stuff is all good from this end)
<ilovethinking> okay give me a sec
<ilovethinking> i think i should look at others' code a bit more/just read up on tutorials since i've been all on my own for now
<heat> no
<heat> tutorials bad
<Amorphia> heat: why bad
<zid> who knows
<zid> but they are
<heat> because people follow tutorials and then get absolutely clueless
<heat> and tutorials are usually very flawed
<zid> all tutorials terrible, universally
<geist> right, it's pretty important about now to start really understanding this
<ilovethinking> geist: btw my os is x86-64, what's the instruction for calling an interrupt? cuz im pretty sure int is for x86
<gog> it's int on x86_64 too
<heat> still int
<geist> should be the same
<geist> might need a # or whatnot in front of the 0x21
<heat> $
<gog> int $0x21
<zid> I think if I made a tutorial I'd include full documentation references. so instead of "We need to write 0x80 here to do thing", it'd be a picture of the manual page with the 0x80 on it
<geist> yah depeneds on which assembler
<zid> so you'd end up following the process I'd have taken
<zid> not just eating what I give you like a baby bird
<geist> yah that's the general problem. most of the tutorials dont giv eyou the context
<sham1> I'm bothered by the multiplication sign being used with the hexadecimal
<heat> geist, I don't think there's any x86 assembler that wants # for constants
<sham1> 0x21
<heat> that's an ARM thing
<sham1> FFW
<sham1> What is wrong with this client
<zid> #6502 life?
<gog> what if 6502 had a mmu
<geist> heat: yeah probably. someone found a old thing in zircon the other day where i had `syscall #99` for some test code on x86
<sham1> Nah, it's just rendering the 'x'es as ×
<geist> and i was like 'oh the 99 is meaningless, just for the immediate field'
<bnchs> #68000 life
<geist> which of course is not true, but i was thinking of SVC instruction at the time
<zid> # is a comment :P
<geist> right, so it assembles it just fine
<gog> oops'
<Amorphia> writing good tutorials is hard
<gog> worst kind of bug, one that compiles correctly :P
<Amorphia> most online tutorials are indeed bad most of the time
<geist> and the people that know enough to write good tutorials aren't in the business of writing good tutorials
<geist> most tutorials i know of are written by peope that *just* learned the topic
<geist> ie, stumbled through it
<gog> yes
<gog> i was writing a tutorial for efi booting
<geist> and basically feel an obligation to give back to the community by slamming down their limited knowledge at the time
<gog> but i realized i'm stupid
<ilovethinking> geist: can confirm it indeed fires.
<geist> perfect.
<geist> so suggestion: go to the other side and poll on the ps2 controller to see if keycodes are appearing
<geist> then you know the keyboard side s working, and you'll need that code soon anyway
<gog> cats have no business writing software, much less tutorials about writing software
<ilovethinking> geist: wait so what do i poll exactly? 0x60?
* Amorphia gives gog some tasty fishies
* gog chomp fishies
<zid> gog video call me your desktop and we'll do it together
<geist> ilovethinking: i dont know off the top of my head
<ilovethinking> yes 0x60
<geist> but there should be a lot of stuff floating around
<gog> zid: you want the first 16 digits of my credit card number, the expiration date and the 3 numbers on the back too?
<ilovethinking> yeah, also i'm like 100% sure i c=
<ilovethinking> oops
<zid> gog: nah just the screen share is fine
<ilovethinking> im sure i have to configure it
<geist> if you write a simple loop on it i bet it'll just start giving you keycodes the instant a key is pressed. and probably 0x0 when it's not. probably
<ilovethinking> the ps2 controller
<ilovethinking> like
<ilovethinking> for it to send scancodes
<geist> possibly. so this way you get to stumble through that first
<geist> it's also possible on qemu it Just Works, unlike real hardware
<heat> it will usually just work because the firmware does it for you
<geist> but this way you can be fairly sure that when you do wire up the PIC and whatnot that the controller is at least functioning and its less stretch to get it to generate an irq
<heat> at least on x86
<ilovethinking> i saw someone configuring the status byte in the osdev forums but i couldnt find anything about doing that on the ps2 keyboard page
<Amorphia> the https://diataxis.fr/ guy has some nice tips on how to write tutorial /plug (i am not being paid to advertise for EvilDMP)
<bslsk05> ​diataxis.fr: Diátaxis
* Amorphia is just a fangirl
<Amorphia> not a paid shill
<zid> Amorphia: you should be, maybe we could get a deal
<Amorphia> lol
<zid> I'll be the socket puppet who goes "wow, what a great link! thanks!"
<Amorphia> :D
<gog> "i really enjoyed this post"
* Amorphia patpat gog
* gog prrprr
<zid> okay gog let's add a console to mine instead then
<gog> just copy my code'
<zid> I thought yours didn't work
<gog> it does
<gog> i made it work
<gog> it's just slow
xenos1984 has quit [Read error: Connection reset by peer]
<gog> and probably not written very well
<gog> one problem at a time
<zid> slow is normal
<zid> 1 microsecond to read from io bus
<sham1> Slow is good
<zid> slow is reliable
<zid> if it does not work you can always hit him with it
<heat> yall want to see a beautiful line
<heat> *(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]);
<zid> hey I recognise that cast
<sham1> Oh god
<gog> lmao
<mrvn> heat: wrong, wrong, stupid, wrong
<zid> p = (struct page_table *)(u32)(p->e[pml4e].entry & 0xFFFFFFFFFE00ULL);
<gog> i had a pet targ when i was a young klingon
<zid> very similar vibes
<kof123> coff? is that uefi or something?
<zid> p = (struct program_header *)(u32)(e->e_phoff + (u32)e);
<zid> I like the variable name p can you tell
<gog> heat works on tianocore
<mrvn> zid: u32? sreiously?
<heat> kof123, it's tianocore code for elf relocation
<heat> gog, i do not
* sham1 slaps heat around a bit with a large trout
<gog> heat: i thought you did
<mrvn> heat: whenever you see a cast on the left side of an assignment you already know it is wrong.
<sham1> zid: but what is p
<zid> p
<Amorphia> heat: what is that cast
<heat> gog, i maintain my ext4pkg but I have ran out of good will towards tianocore and its shitty corps
<zid> page table, program header, pointer
<zid> works for anything
<gog> heat: fair
<Amorphia> it looks horrifying
<sham1> That's a non-descriptive name. Wouldn't get through code review
<gog> actually really glad i didn't take the task of implementing code sharing
<heat> gog, they suck the soul out of you, seriously. thank god you didn't dive into it
<zid> It has a type
<zid> that is only used for it
<sham1> Still
<zid> it doesn't need a name
<heat> gog, plus the PeCoff lib stuff is DISGUSTING
* sham1 slaps zid around a bit with a large trout
<bslsk05> ​'it working' by gog (00:02:07)
<gog> see it work
<sham1> God damn
<sham1> I'm just all full of legacy references
<zid> heat do you like my casts too or nah
terminalpusher has joined #osdev
<mrvn> Amorphia: that cast will reformat your harddrive and install bsd. Maybe, if your compiler feels like it.
<Amorphia> mrvn: :O
<zid> gog: I thought this was supposed to be ps2 demo
<mrvn> Amorphia: unless Targ is an (UINT32), in which case the cast is just not needed.
<heat> zid, I guess
<gog> zid: no i haven't done that yet
<zid> I like watching the P bit flash in the RFL
<heat> gog, riveting demo btw
<zid> it's relaxing
<gog> yes
<gog> it's very exciting
<sham1> I know an Eleanore Semaphore when I see her
<heat> there should be a type called "mjg"
<gog> the only locking primitive i have is preventing interrupts during task swithcery
<zid> gog: so we're not adding keyboard to mine? :(
<gog> zid: not tonight
<zid> "I have a headache"
<zid> that's what you always say
<gog> hahahah yes
<Amorphia> gog: what was the first thing you did whne you started writing sophia
<zid> I'm the only one doing any work to keep this marriage together
<heat> Amorphia, ur mom
<mrvn> gog: that is an unlock primitive though. all tasks hold the lock except the running one releases it.
<Amorphia> heat: :o
<Amorphia> i didn't ask you, though ;lv
<gog> mrvn: hm yes
<Amorphia> :v *
<gog> Amorphia: the first thing was rewriting my old elf loader
<gog> making it a little simpler and general
<gog> sophia is an amalgamation of rewrites of prior experiments
<Amorphia> don't you need a shittonne of othe infrastructure before you- ah
<gog> the infrastructure i use to load elfs comes from UEFI
<gog> UEFI makes it trivially simple to write basic boot loading
dutch has joined #osdev
<Amorphia> but dont you need to boot and set up page tables and shite first
<gog> yes
<gog> but UEFI has everything i need to allocate pages and pass the memory map to the kernel when leaving boot services
<gog> same with video information
<Amorphia> ok so walk me through what happens from machine switch on to UEFI to being passed to kernel when 'leaving boot services
dutch is now known as SpikeHeron
<gog> a lot of things
<gog> UEFI does more than i know
foudfou has joined #osdev
<gog> there's several stages that the firmware passes through
<Amorphia> apparently im not making myself clear enough
<sham1> Probably best to describe what happens after you exit boot services
<sham1> Like what do you do
<Amorphia> i want to know what happens when you boot your UEFI
<Amorphia> and do bootloader jazz
<Amorphia> and the load sofia
<gog> oh, ok
<gog> i infer the ESP by getting the loaded image protocol of the boot image and reading its DeviceHandle
<gog> then i query for a simple file system protocol on that device handle
ilovethinking has quit [Remote host closed the connection]
<gog> then i use the file protocol that the SFS protocol gives me
<Amorphia> UEFI has file system protocols? :o
<gog> it supports FAT by default yes
<Amorphia> no fuckin way
<Amorphia> p sure BIOS didn't have that
<Amorphia> did BIOS hvae that?
<Amorphia> its been so long
<zid> I mean, mine did, but not exposed by the interrupt api
<gog> i think later ones did with their bios flashing app
<gog> if they had one
<zid> EZFLASH II
<gog> yeah
<Amorphia> okok let's forget about learning any proper kernel shit
<gog> but anyhow, then the loader opens two images: boot.os and kernel.os
<Amorphia> my first step ought to be experimenting with the UEFI api
<Amorphia> and learning my way around that shit
<gog> jumps to boot.os which relocates itself, sets up page tables and gets memory maps and video information, then installs the page tables and remaps itself again
<zid> My plan is to ignore uefi until grub stops working in 2050
<mrvn> zid: why would it stop?
<gog> then jumps into kernel.os which also remaps itself and jumps to its main
<Amorphia> gog: neat
<gog> also boot.os exits boot services before jumping to kernel entry
<Amorphia> which bits of your repo do i wanna look at for where this stuff is in code
xenos1984 has joined #osdev
<gog> Amorphia: loader and kc/boot
<Amorphia> ok :-)
<gog> zid: valid
<zid> isi t monday 10pm yet
<gog> it's sunday 9pm GMT
<gog> unless i totally forgot to go to work today
<gog> no it's sundcdday
<gog> lmao
<zid> hrmph how do I make it 10pm monday
<mrvn> zid: drugs, lots and lots of drugs
<gog> what happens in 25 hours
<mrvn> recovery from a case of the mondays?
<gog> Amorphia: that reminds me we should watch office space together'
<gog> s/we should/i would like if we/
* Amorphia coughs
<Amorphia> oh, you corrected yourself faster than i reacted
<Amorphia> well done
<gog> :)
* Amorphia pepetpet gog
tacco has joined #osdev
<Amorphia> also that movie is great, would be fun to rewatch it
<FireFly> I swear I keep mixing up when cycling between channels sometimes the way this is going
<gog> lmao FireFly
<sham1> Yay, tomorrow is monday
<gog> boo
<gog> i'm not ready for monday
<sham1> I like Mondays
<FireFly> I'm not ready for monday either
<Amorphia> FireFly: wdym
<FireFly> well I cycle through channels and see some conversation between you & gog and think I'm elsewhere than in #osdev :p
<zid> do they have secret hangouts
<Amorphia> yes, we belong to a secret society
<Amorphia> Libera freemasons
<FireFly> just small-irc-network effects
<zid> I wouldn't join any society that'd have me as a member
<FireFly> that's like, the opposite of a set-theoretical paradox
<heat> when are .got/.plt entries required?
<zid> err heat
<heat> i was born in 2002 idiot
<heat> suck it
<zid> that.. is my point
<Amorphia> gog, FireFly do we tell them where we hang out or keep it a secret
<zid> birth years can't start with 2
<Amorphia> secrets are kinda fun i guess
<Amorphia> :3
<zid> for obvious reasons, it's impossible
<sham1> Imagine being a post-millenium person
<gog> heat: they're not at the moment
<gog> that's for ${future reason}
<gog> it's a secret
<FireFly> sham1: I'm post-millenium, I was born after year 1000
<sham1> Second millennium
<zid> yea I am significantly post millenium
<Amorphia> i was born post millenium but pre-second millenium
* FireFly posts milleniums
<heat> gog, but srsly when
<heat> I can't tell
<heat> -shared only?
<gog> yes
<zid> .got .plt get generated a lot more often than they're required
<zid> or at least used
<heat> so I can have a got-less and plt-less static-PIE right?
<gog> each entry of the plt will contain a jump based on the .got.plt
<gog> if we're doing lazy resolution
<gog> the .got.plt contains a pointer to the resolution function
<gog> if not it contains a pointer to the function
<gog> the plt just does an indirect from the contents of the pltgot
<gog> or gotplt
<gog> whatever it's called
<gog> it's confusing
<heat> with all this I assume PIE is restricted to +-2GB
<gog> i'd have to double check the spec but i think so
<Amorphia> i vaguely remember this from some reversing/ctf shit i was doing with FireFly at some point, these lil dummy fns that jump to the real library fns
<gog> yes, that's the plt
<moon-child> Amorphia: do I get to know where you all hang out
<gog> Procedure Linkage Table
<zid> it's cute, there's basically a stub that does GetProcAddress
<moon-child> actually i can probably guess
<zid> then replaces itself with 'call addr'
<zid> is it ##re
<zid> where they do things twice
<Amorphia> moon-child already guessed it :o
<gog> afaik most libraries are set up for LINK_NOW
<gog> rather than lazy linking
<gog> so the got and pltgot aren't really necessary
<gog> or at least don't need to be loaded
<heat> no, they're not
<heat> but the got is required
<gog> for my purposes though
<gog> i will need both
<heat> because you can't patch .text
<gog> yes
<gog> well, you _can_
<gog> if you have relocs
<gog> which you can also generate
<heat> you can't because ldso will die
<gog> o
<heat> or Rcrt1
<gog> i thought you mant it wasn't possible rather than not possible under those implementations
<gog> my os is gonna be zombo os
<gog> anything will be possible
<heat> well, also places constraints on library placement a lot more
<gog> the only limit will be yourself'
<mrvn> heat: PIE requires GOT/PLT when it's >2GB, it gets one when it's potentially >2GB and sometimes even just for fun
<mrvn> gog: the PLT is there so a) you don't have to patch every call of a function in .text, b) cluster all the modifications in as few pages as possible.
<gog> yes
<gog> i really need to get back to work on the thing that's going to use that
<Amorphia> i think the thingy i was reversing was PIE, hence GOT/PLT
* gog eats the PIE
<mrvn> I really just want a switch for gcc to not generate a GOT/PLT and simply let me patch .text.
<sham1> -fno-plt
<sham1> That would be nice
<sham1> Sadly it doesn't exist
foudfou has quit [Remote host closed the connection]
<mrvn> Without shared pages a PLT makes little sense.
foudfou has joined #osdev
<Amorphia> PIE is position independent executable right?
<mrvn> by the way, how does dynamic resolution in the PLT work with X^W? Does it remap the page for every single (first) function call?
<mrvn> Amorphia: that's what the letter stands for but it is not. It's relocatable.
<Amorphia> aha
<mrvn> Amorphia: If you are real carefull and lucky you can make a PIE executable with 0 relocations and then truely have a PIE
<CompanionCube> Amorphia: not only does UEFI do FAT (and sometimes other filesystems depending on vendor), you can extend it with additional drivers, such as heat's ext4 one, or btrfs, or any filesystem GRUB can read (not sure how well those work)
<Amorphia> :o
<Amorphia> CompanionCube: fuckin nice
<sham1> UEFI is truly a heckin' chunker
<zid> speaking of hecking chunker, this is random youtube mix has some hecking chunker tracks
<zid> and squardle is kcijing my ass
<GeDaMo> American spellings
<zid> there's like three diff squardles though, I mean https://squaredle.app/
<bslsk05> ​squaredle.app: Squaredle | Daily Word Search Puzzle
<GeDaMo> Yeah, that's the one
<zid> how can there be 12 more 6 letter words when it's all gblkffmddl :(
<GeDaMo> There's a few double ds and fs
<zid> I have some double ffs done
<zid> I left my double Ds in the shop, mechanic says he'll hav them reinflated soon
<FireFly> :o
<sham1> Yay
<zid> also what they count as a bonus word is bizzare
<zid> bizarre
<zid> doff, fens both perfectly cromulent words
MiningMarsh has quit [Ping timeout: 268 seconds]
<zid> GeDaMo I found everybody's favourite snack
<GeDaMo> I didn't get that one :|
<gog> muffens
<gog> i prefer biscuits
<zid> I'm on 27/65, bonus, 2 7s, 3 6s, 6 fives, 17 5s
<zid> 17 4s*
<zid> getting clobbered
<gog> nya
* zid finds two more 4s
<GeDaMo> There's a few plurals
<zid> wlel y ea, there's two s
<zid> 4 of my 5 letter words are just 4 letters + s :P
<zid> when I get to the ca***s stage I'll do better
<CompanionCube> mrvn: isn't the W^X thing related to RELRO?
MiningMarsh has joined #osdev
<yuriko> nya
<mrvn> CompanionCube: no. It means that you map pages eigther executable or writable but never both.
<CompanionCube> mrvn: well, i mean it's related in the sense that it means you don't need to keep certain bits writable and executable, at least that's what i got from reading https://www.redhat.com/en/blog/hardening-elf-binaries-using-relocation-read-only-relro
<bslsk05> ​www.redhat.com: Hardening ELF binaries using Relocation Read-Only (RELRO)
<heat> the plt is never writable
<mrvn> heat: then how does dynamic resolution work? At first all the entries point to the function that does symbol resolution.
<mrvn> is that using indirect jumps by loading the address from the GOT?
tacco has quit [Remote host closed the connection]
<bslsk05> ​maskray.me: All about Procedure Linkage Table | MaskRay
<mrvn> Also if it's not writable then why not simply have it in .text?
<heat> it is in .text
roan has quit [Ping timeout: 252 seconds]
<mrvn> no, it's in .plt
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<heat> 01 .note.gnu.build-id .dynsym .dynstr .gnu.hash .hash .rela.dyn .rela.plt .plt .text .rodata .eh_frame .eh_frame_hdr
<mrvn> thanks for prooving my point
<heat> i..... i give up
<sham1> Good
<sham1> Sometimes you just have to give up
<heat> yeah that has become painfully obvious
<zid> down to c**** d**** ch**** ch**** do**** now
<geist> the only winning move is not to play
<zid> and done, phew
<sham1> I should watch that movie
<sham1> Then again, I should watch a lot of movies
<geist> i think it ages pretty well, to be honest
<geist> even considering it has computer stuff in it which tend not to
<geist> they actually did a good job making sure what computer stuff it has is accurate/etc
immibis has joined #osdev
immibis has left #osdev [https://quassel-irc.org - Chat comfortably. Anywhere.]
<geist> it's not accurate in he sense that sure they didn't come up with AIs in the 80s, but the parts where people use computers they dont just do some hand wavy pacman eating the links on a map sort of shit
joe9 has joined #osdev
<geist> (talking about the original War Games movie)
<mrvn> geist: other than how the hardware looks and the lack of fancy graphics crap on the graphics it all still works.
SpikeHeron has quit [Quit: WeeChat 3.8]
<geist> like they clearly brougt in computer people to help design scenes where you interact with computers
<zid> the most accurate 'computers really work like this' movie is of course, Hackers
<mjg> OH
<mjg> GARBAGE FILE
<zid> matrix reloaded has trinity running nmap against a machine though, for about a tenth of a second
<zid> she being a famous hacker in the real world
<mjg> just be happy you are not a medical profesisonal
<mjg> watching a fucking movie
<zid> or astronomer watching titanic, smh ruined
<zid> not even the right season
<mrvn> zid: you have to love the chaining of public telephones.
<mrvn> zid: Ever tried locating the film location from pictures of the night sky and time/date in the film?
<geist> yah if some filmmaker starts with something halfway realistic and then extends it i'm willing to go with it, it's when they clearly just didn't consult anyone about anything and just make stuff up as if it was some sort of non techy dream about it that drives me nuts
dude12312414 has joined #osdev
<mrvn> geist: Like when you have a spaceship with a rotating section and a piece breaks of and flies along the axis of the ship.
<mjg> you know why geist using his realname on irc
<mjg> because z3r0c00l was already taken
<geist> honest admission: I've never seen hackers
<mjg> whoa man
<mjg> wtf
<geist> at the time it came out i was much more poo pooing on that kinda stuff
<mjg> totes go watch, but expect cringe
<geist> now i think i realize it's a cult classic *because* it's so cringe
<mjg> hell ye
<mjg> so bad it is good
<geist> but at the time i was not into cringe for cringe sake
<geist> yah
<mrvn> geist: What I find even more annoying is when they actually do things correctly until they simply drop it for story reasons. And right after they are back to correct.
<zid> I don't think it's that cringe
<zid> it's just.. very not accurate, because, of course it isn't
<zid> like, they didn't try for accurate
<zid> it's a "subculture" movie
<mjg> do you even know what's in GARBAGE FILE
<geist> right but that's kinda the problem. when they go for completely inaccurate for something that at least you and i know a thing or two about it, it's more infuriating
<geist> it'd be like i dunno those fast and furious movies if you know a thing or two about driving a car
<mjg> see man, i gave up on realities in movies
<mrvn> zid: It's got Angelina Jolies B00Bs, you have to love it. :)
<geist> but yeah, anyway. the notion that it's totally not trying gives it a bit of an escape
<mjg> people get shot in an arm or leg, and 2 days later screen time they are good as new
<zid> spekaig of getting shot, that shit isn't incapacitating
<zid> if you're in a gunfight and you get shot, you barely notice
dutch has joined #osdev
<zid> "The fuck, did someone just punch me while I'm having a gunfight? rude, anyway *bam bam bam*"
<mrvn> zid: but the day after you feel it
<geist> well, i figure stuff like 2 days later is just accelerated timelines
<kof123> f&f answers the age-old mystery: MAGNETS: How Do They Work?
<geist> kinda like how in games you can assume that 5 minutes of walking across the map is really like 2 weeks or something
<geist> because everything is super compressed. the entire kingdom of Hyrule is not like 5km square
<zid> every movie ever though, shoot random soldier in stomach and he's either unconscious or dead within milliseconds :P
<zid> geist: Final Fantasy 1 realism version, you step out of the caste and die of dysentry.
<mrvn> zid: and nobody ever gets shot in the head when that is the only way to kill them.
<zid> white mage is struggling behind because he has gout
<zid> thief dying of sepsis after a rat bit him
<geist> Final Fantasy X Oregon Trail crossover. go!
<mrvn> .oO(The sword is twice as long as the character is high and weighs 3 times as much)
<zid> That's for coming to my 'dark souls is the best video game' TED talk.
<heat> it is
<zid> thanks*
<heat> dark souls 1 realism version: hollows are yucky, i'ma stay in my cell
<kof123> black mage menu: >fight >pluck piece of hair off monster >item
<sham1> Dark Souls is realistic though. You have to PRAISE THE SUN
<zid> and a rat bit me and now I am slowly dying of poison
<heat> zid, you're IRL patches
<mrvn> I really liked how space flight in Babylon 5 is realistic. Ships turn on a dime and accelerate in straight lines.
<mrvn> No swooping curvels like they have athmosphere in space.
<sham1> Directors not knowing how space works? Typical
<sham1> It's nice that Bab5 at least knows
<zid> gravity is a cool movie
<zid> it has no idea how gravity works
<mrvn> zid: with a bit of suspense of disbelieve it's still tons of fun
<mrvn> I think I will watch gravity. Was looking for something to watch before bed.
fedorafan has quit [Ping timeout: 252 seconds]
<mrvn> .oO(If I can find out what country I need to be in and what streaming service to use so it's available)
fedorafan has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
bch has joined #osdev
Iris_Persephone has joined #osdev
<Iris_Persephone> hey guys
<gog> hi
<moon-child> Iris_Persephone
<heat> moon-child
<Iris_Persephone> heat
<gog> heat: moon-child
<moon-child> Iris_Persephone: gog
<gog> gog: gog
* moon-child purrs
* gog pets moon-child
<Iris_Persephone> man why are IRC clients so clunky
<heat> because irc sucks
<zid> irc fine, discord clunky
<heat> and no one that has ever touched IRC knows a hint of UX design
<Iris_Persephone> discord is great, they just keep adding on shit nobody asked for
<zid> we have wildly different definitions of clunk then
<Iris_Persephone> it's like
<sortie> Sunday osdev: https://irc.sortix.org now runs the latest NGINX running natively on my Sortix OS, with my official network stack connected straight to the public internet, secured as TLS 1.3 via LibreSSL.
<bslsk05> ​irc.sortix.org: irc.sortix.org
<sortie> https://www.ssllabs.com/ssltest/analyze.html?d=irc.sortix.org ← The TLS config even gets the A+ grade and even has the CAA DNS entry set up so only Let's Encrypt can issue certificates
<bslsk05> ​www.ssllabs.com: SSL Server Test: irc.sortix.org (Powered by Qualys SSL Labs)
<gog> sortie: neat
<heat> >LibreSSL
<heat> ohno
<Iris_Persephone> using IRC is like driving a heavy car with an underpowered engine and no power steering, but using Discord is like driving a car with way too many dials on the dash because the designers added all the fiddly bits they could think of
<sortie> heat, A+
<gog> irc is like driving a motorcycle to me
<gog> it's light and it's fast
<heat> with OpenSSL or BoringSSL it would be an S+ and you know it
<zid> tls has a POODLE attack apparently
<gog> but you can crash and hurt yourself really easy
<zid> discord using 2GB of ram and it takes 20 seconds to do anything
<sortie> heat, but you trust OpenSSH from the same people with your life
<zid> perfect experience
<heat> sortie, barely
<gog> discord is a website that you download and it runs in chrome in a window
<Iris_Persephone> the reason I make that comparison is that it feels like I have to manhandle IRC to get what I want
<zid> I want to type into a box and hit enter to annoy people
<zid> 100% succesful
<sortie> heat, I also just ported the very latest openssh
<gog> zid: same
<heat> sortie, it's astonishing how they haven't started removing random features or padding my ssh input with TRAPSLEDs
<FireFly> meow
<sortie> They actually literally just removed the \n~C escape-to-secret-ssh-prompt escape sequence
<sortie> (by default, you can config it back)
gildasio1 has quit [Ping timeout: 255 seconds]
<heat> "lets make rand() not be rand()"
<sortie> heat, how are you be part of the conspiracy against good random
<clever> sortie: the IPMI console on one datacenter i use, tells you to hit ~. to disconnect, because its often in a read-only mode, i could see that becoming an issue
<sortie> Not kidding I am 100% on the OpenBSD random train
gildasio1 has joined #osdev
<sortie> Fuck all those shitty legacy interfaces
<gog> yes
<heat> sortie, so rand() is a deterministic PRNG. it's defined as such by the standard.
<gog> fuck legacy
<Iris_Persephone> just have your random number function return 4
<bslsk05> ​gitlab.com: libc/stdlib/rand.c · staging · sortix / Sortix · GitLab
<heat> you are 100% in my train
<sortie> clever, yeah \n~. is super handy and also works even if the remote is unresponsive
<Iris_Persephone> it's guaranteed to be random, I just rolled the dice for it
<sortie> You can reenable it again easily with a config or -o option, but it's off by default to harden now
<klange> '36969' three nice nice
<sortie> heat, don't care about standards when they're in the way :)
<heat> also, spinlock in rand? ew
<sortie> What matters is applications working well
<heat> s/spinlock/mutex/
<moon-child> dafuq
<moon-child> why
<heat> to make it "thread safe"
<sortie> heat, you can't have it both ways!
<moon-child> clearly, it would be much better to do a cas-loop over the random state
<moon-child> :^)
<heat> rand_r
<sortie> heat, this one does try to be the old deterministic one and tries to do it well
<moon-child> pls
<sortie> Although note that all uses of rand() in Sortix _does issue a warning_ and I usually fix those in ports
<klange> what do you expect instead of rand?
<sortie> arc4random no questions asked
<heat> chacha69random
<sortie> If you want a nice deterministic random number generator, roll your own in the app, you can't rely on the libcs being similar and replayable
<sortie> (only being replayable within the same process)
<sortie> klange, idk read some socialist author instead?
<moon-child> lol
<heat> zizek()
* gog schniff
bch has quit [Ping timeout: 252 seconds]
<bslsk05> ​git.kernel.org: man-pages/man-pages.git - Linux man pages Sections 2, 3, 4, 5, and 7
<sortie> But yeah nginx! It was an easier port than I thought, surprisingly worked on the first try. The port got a little dirty with lots of small patches especially some build system ones, the end result is working pretty darn well
<bslsk05> ​git.kernel.org: man-pages/man-pages.git - Linux man pages Sections 2, 3, 4, 5, and 7
<sortie> It's literally serving modern TLS 1.3 with HTTP/2
<heat> linux man-pages is getting mismanaged to shit
<bslsk05> ​git.kernel.org: man-pages/man-pages.git - Linux man pages Sections 2, 3, 4, 5, and 7
<bslsk05> ​git.kernel.org: man-pages/man-pages.git - Linux man pages Sections 2, 3, 4, 5, and 7
<sortie> stpncpy now that's a bit cute
terminalpusher has quit [Remote host closed the connection]
<heat> man-pages has essentially become the new maintainer's opinionated piece on C
<klange> wtf that vla thing is completely illegal
<heat> it is! it also looks like ass!
<sortie> It is kinda handy that it's readily available what the expected buffer lengths are
<sortie> I did spot those showing up in my manuals all of sudden
<klange> but the manual pages should list valid declarations, and those are not valid declarations
<heat> if he wanted the vla syntax he could've at least gotten something a bit more... natural?
<sortie> heat, technically there IS such a valid array format
<heat> char buf[size] <-- this would be wrong but passable
<heat> no idea what char buf[restrict .size] is
<sortie> int foo(int bar[4]) { return bar[3]; } ← This is valid btw although it does not actually require it to be an array of length more, it's more like documentation
<heat> I know
<klange> int foo(int bar[baz], int baz) is completely illegal
<sortie> int foo(int bar[restrict 4]) { return bar[3]; } ← This does compile too
<heat> C23 "recommends" the horrible syntax int foo(int size, char buf[size])
<klange> it recommends the ordering when designing APIs so that you can do that, it does not "recommend" the syntax
<klange> the syntax is _defined_, that is a valid declaration; swapping the order is not
<heat> yes, it's a valid declaration but a horrible API and ordering
<sortie> int foo(int size, int bar[restrict size]) { return bar[3]; } ← I can't believe -std=c99 -pedantic eats this
<klange> and the change the manpage author made is to apply that syntax in a bunch of places where it's illegal because the size comes after
<heat> yes, also adds a .
<heat> for some reason
<sortie> Yeah the . is the wrong part here
<heat> everything is wrong
<sortie> The rest is technically kinda valid
<klange> the ordering is the main wrong part
<klange> the author even spends three paragraphs explaining they don't give a shit
<heat> can't wait for fork.2: In my book, fork is deprecated
<klange> just wait for all of the manual pages to be replaced with "C is deprecated, switch to rust"
<Iris_Persephone> they can't do that can they?
<heat> do what?
<Iris_Persephone> c is the standard
<heat> huh?
<Amorphia> standards can be deprecated...
<Amorphia> also C is a language not a standard
<Amorphia> isn't it?
<Iris_Persephone> no I mean
<Iris_Persephone> it's the go-to language for low-level that isn't assembly
<Amorphia> yeah but it might well be that Rust will become the go-to
<Amorphia> if llvm can get their shit together with more target archs
<Iris_Persephone> what has rust ever done for us
bch has joined #osdev
<Amorphia> the borrow checker
x8dcc has quit [Quit: leaving]
<Amorphia> helpful compiler error messages
<Amorphia> fast zero-cost abstractions
<heat> >zero-cost
<heat> lie
<bslsk05> ​'CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”' by CppCon (00:59:52)
<Amorphia> :O
<Amorphia> heat: i feel cheated
<Iris_Persephone> there ain't no such thing as a free lunch
<Iris_Persephone> you should write directly in machine code for maximum performance
<klys> forget "writing" machine code, there's too much writing to do. mebby "optimize" your code with assembly
<mrvn> heat: restrict has something to do with the array being allowed to be bigger or not I think.
<mrvn> ahh, no, I remembered wrong. restrict is an anti-alias.
<Amorphia> heat: lmao the biggest abstraction is writing Python that emits C++ XD
<Amorphia> fantastic
MiningMarsh has quit [Quit: ZNC 1.8.2 - https://znc.in]
fedorafan has quit [Ping timeout: 252 seconds]
fedorafan has joined #osdev
<Iris_Persephone> obviously you should just write the whole thing in Visual Basic
<mrvn> Iris_Persephone: logo with turtle graphics