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
<geist> i'm kinda stuck to be honest. every time i think about doing something grander with LK i think of all the folks i'll break downstream
<geist> so i just sort of fiddle with it
<geist> and port it to new things as long as i dont break anything else
<nikolapdp> you can have a separate fork that builds on it maybe
<heat_> Ermine, exists in a PR, that PR has some problems, i haven't been able to successfully run it on actual ARM cores
<nikolapdp> and backport some useful stuff
<geist> a lot of the big things i want to do is like rewrite the driver layer, etc. things that will maximally break people
<geist> so i dunno.
<heat_> fork?
<Ermine> geist: It's nice you're so responsible, but concerned folks could pay you as well
<geist> thsi is true
<gog> help me kernel
<gog> you're my only hope
<Ermine> heat_: oh. Maybe I'll get myself some eval board eventually
<geist> heat_: oh you want me to try it out on something?
<geist> or did you boot it on qemu?
<heat_> i'm getting some timer issues and i'm not sure what those are
<heat_> i booted it on qemu kvm
<heat_> linux boots IIRC, so it should work, even if rpi kernels don't compile KVM in by default
<heat_> i *suspect* that the arm timer ticks so slowly that i'm getting problems in my fixed point path
<heat_> s/path/math/
<leg7> Do you guys run a service to get the chats you missed when you were gone or nah?
<geist> hmm, possible
<geist> i use irccloud, which stays logged in all the time so yeah
<geist> not that much different to discord in that sense
<leg7> should I use that?
<heat_> anyway, i haven't looked at it in a loooooooooooooong time. might do so in the future, i'll ping you if i need help
<geist> but before that i would just run a command line irc client on a machine that i'd screen into
<geist> like the VAAAAAX
<leg7> yeah my raspberry pi server has been down for a while though so I can't do that
<heat_> VAAAX as an irc bouncer is like the most expensive heater ever
<geist> actually now that i have a full account on sdf.org i could switch to using that again
<leg7> Whatever Ig I'll miss chats *shrug*
<geist> heat_: well, a microvax is surprisingly low power
<heat_> isn't sdf super slow?
<geist> heat_: for a irc client does it need to be fast?
<geist> i mean my VAAAAX does it just fine
<geist> or my 386 dos machine
<heat_> it doesn't need to be fast, but it probably shouldn't be super slow either
<geist> but really i should finish my irc client on LK and use that on some board. that's the Achievement some of us have unlocked around here
<heat_> but idk how slow sdf is
<leg7> guys thanks for helping me debug the gdt
<geist> it's not particularly. sdf shells are just into one of about 8 fairly reasonable netbsd machines
<leg7> It's 2am
<leg7> gtm
<leg7> gtg*
<geist> maybe 100 people logged in, but most people are just running some command line app
<geist> leg7: later! grats on getting it working
<leg7> ^^
<leg7> o/
<nikolapdp> my irc client is running on a pdp-11 emulated at realistic speed
<nikolapdp> irc clients are not very demanding
<geist> nikolapdp: hmm, i was just thinking of doing that? what OS is that on?
leg7 has quit [Remote host closed the connection]
<nikolapdp> this is bsd 2.11
<geist> i have RSX11m running on mine right now, but i doublt there's an IRC client there
<kof673> sdf use to run alpha on netbsd IIRC :D
<kof673> *netbsd on alpha
<nikolapdp> i sent you my port of sic haven't i, geist :)
<heat_> does 2.11 BSD have named fifos?
<geist> nikolapdp: ooh no. i was gonna ask what irc client is available for BSD 2.11?
<heat_> if so you could use that horrible suckless irc client that uses fifos
<geist> i would lvoe to get that running on my pidp11 or so
<CompanionCube> geist: there is also an openbsd one now
<bslsk05> ​Minnerlas/sic - Sic IRC client for BSD 2.11 (0 forks/2 stargazers/MIT)
<nikolapdp> i ported it to 2.11 a while ago
<geist> oh cool, will do!
<CompanionCube> https://sdf.org/?status load looks fine too
<bslsk05> ​sdf.org: SDF Public Access UNIX System - Free Shell Account and Shell Access
<Ermine> there's ahti.space also
<geist> CompanionCube: yeah, it's surprising (not really) how many shell accounts a modern machine can sustain at once
<geist> simple command line stuff you probably run out of /dev/tty entries before the machine starts to show load
<geist> unless everyones compiling at once or whatnot
<heat_> Ermine, you have an ahti acc?
<Ermine> I don't
<geist> nikolapdp: is that yours?
<Ermine> but you do I guess?
<geist> like did you write it from scratch?
<heat_> yeah i have one
<nikolapdp> no, i ported it geist
<heat_> sic is what the naz- i mean the suckless people have
<geist> it is MIT, i might be able to port it to LK. honestly the main reason i dont do much with IRC on LK is because i really have no interest in writing an IRC client aside from the very basics
<heat_> they think its a great great client
<geist> oh hmm, seems to rely on select and whatnot
<CompanionCube> the thing with irc-on-sdf is that they don't include screen/tmux in the one-time upgrade, that's part of a monthly package with mostly other stuff
<heat_> geist, write a unix
<nikolapdp> yeah it's waiting on stdin and socket
<heat_> on top of lk
<Ermine> heat_: gotta admit that the idea is ingenious, though it's not practical
<geist> yah i've been fiddling with it fro time to time, but honestly dealing with libc is so much un-fun i just ugh
<Ermine> like pifs
<heat_> geist, use musl and implement the linux interface, ez
<geist> pifs like the things in windows 3.1 to point to a program?
<heat_> well "ez"
<geist> heat_: i did make an attempt at it
<geist> got it kinda compiling
<heat_> you don't need to deal with libc is my point
<heat_> musl even packages its own uapi headers
<geist> i mean i have it kinda working with newlib, but only to the poit that it starts and runs a few user programs
<geist> but then i got side tracked trying to finish the FAT implementation so i had enough FS to do something interesting with
<geist> and clever was working on ext4 at the time, so i left that to him
<bslsk05> ​philipl/pifs - πfs - the data-free filesystem! (291 forks/6557 stargazers/GPL-3.0)
<geist> but then clever didn't finish it.
* geist curses clever
<heat_> your big problem is that as soon as you start implementing UNIX you'll need to rework stuff to be more complex
<Ermine> s i m p l i c i t y
<heat_> like you'll need a full vfs for basic fd usage and poll and all that jazz
geist-sdf has joined #osdev
<geist-sdf> ah here we go
<Ermine> Hello there
<heat_> netbsd
<nikolapdp> hello there
<geist> heat_: yeah i had implemented a fair amount of that for newos back in the day
<geist-sdf> i should leave a client connected here too
geist-sdf has quit [Client Quit]
<Ermine> which shell is there on sdf?
<geist> looks like a giantic array, base don what is in /etc/shells
<geist> pretty much anything you could want
<geist> the default seems to be ksh
geist-sdf has joined #osdev
masoudd_ is now known as masoudd
<heat_> is there a way to get a block IO journal from QEMU? or at least some kind of log
<geist-sdf> like a log of all the activity other than -d trace:something?
<heat_> -d trace would be /okay/ as long as there's some stable-ish tracepoint to attach to
<heat_> ideal would be an actual journal
<zid> geist is doing signed distance fields now?
<zid> oh nikolapdp is alive
<nikolapdp> hello zid
<zid> nikolapdp did you EoE yet
<nikolapdp> not yet
<zid> smh
<zid> do it quick before shinji's mental state evaporates from your consciousness
<zid> you really wanna be in the zone the moment it starts
<nikolapdp> lol
<zid> cus.. of a certain scene
<nikolapdp> lol ok
nanobot567 has joined #osdev
<Ermine> what are you trying to accomplish?
<heat_> debug fs corruption
<geist-sdf> yah a log of all the writes would be ace
heat has joined #osdev
<heat> i need something to just... randomly trace functions
<heat> that would be great
heat_ has quit [Read error: Connection reset by peer]
<heat> i think logging all the writes wouldn't be as amazing as i was thinking cuz then i'm lacking all of the context
netbsduser has quit [Ping timeout: 264 seconds]
<Ermine> I have no single idea of how kvm works, but maybe it's doable with some ebpf program?
<heat> no, most (virtually all) devices are handled in qemu
goliath has quit [Quit: SIGSEGV]
gog has quit [Ping timeout: 272 seconds]
heat has quit [Remote host closed the connection]
heat has joined #osdev
netbsduser has joined #osdev
zxrom has quit [Quit: Leaving]
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
<zid> some bastard thing bit me, I blame heat
<heat_> sorry
Matt|home has joined #osdev
Matt|home has quit [Remote host closed the connection]
Matt|home has joined #osdev
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #osdev
<heat_> found the bug
<heat_> my nvme driver was mishandling the case where i had 2 sgls instead of >= 2 or just 1, so i was writing trash to contiguous sectors when block IO plugging was happening (and i was merging requests)
asarandi has quit [Quit: WeeChat 4.1.1]
asarandi has joined #osdev
vykt has joined #osdev
asarandi has quit [Quit: WeeChat 4.2.2]
asarandi has joined #osdev
asarandi has quit [Quit: WeeChat 4.2.2]
asarandi has joined #osdev
Fingel has joined #osdev
stolen has joined #osdev
Arthuria has quit [Ping timeout: 256 seconds]
GeDaMo has joined #osdev
Fingel has quit [Quit: Fingel]
heat_ has quit [Ping timeout: 256 seconds]
nanobot567 has quit [Quit: Into the abyss I go!]
craigo has quit [Quit: Leaving]
gbowne1 has quit [Quit: Leaving]
op has joined #osdev
rustyy has quit [Quit: leaving]
stolen has quit [Quit: Connection closed for inactivity]
rustyy has joined #osdev
Gooberpatrol66 has quit [Remote host closed the connection]
SGautam has joined #osdev
Gooberpatrol66 has joined #osdev
zxrom has joined #osdev
navi has joined #osdev
leg7 has joined #osdev
leg7 has quit [Remote host closed the connection]
leg7 has joined #osdev
op has quit [Remote host closed the connection]
masoudd has quit [Ping timeout: 256 seconds]
gog has joined #osdev
Left_Turn has joined #osdev
<leg7> btw
<leg7> whoever told me I couldn't have the intel manual under cvs was right
<leg7> so I removed it
<leg7> :(
<leg7> proprietary 0s and 1s
<leg7> nice read tp
<leg7> ty*
Left_Turn has quit [Ping timeout: 268 seconds]
<Ermine> books tend to be proprietary
<zid> anything written down by anyone is instantly copyrighted
<zid> you need a licence to do anything with it
<leg7> not really afaid if you write down something it's unlicensed
<leg7> afaik*
vai has quit [*.net *.split]
<zid> where heat
<bslsk05> ​i.imgur.com <no title>
Left_Turn has joined #osdev
bitoff has joined #osdev
SGautam has quit [Quit: Connection closed for inactivity]
SGautam has joined #osdev
bitoff has quit [Ping timeout: 260 seconds]
netbsduser has quit [Ping timeout: 252 seconds]
<leg7> When you read hex codes do you convert them to binary in your head?
<leg7> or decimal?
<leg7> I find myself always converting to binary
<zid> depends what I am doing?
<leg7> ok
<zid> "number of elements in this array", decimal
<zid> "This is a bitmask for selecting bits 13 throug 17", binary
<zid> "this is an address", hex
<zid> etc
<leg7> ok I was wondering when do you just interpret it as hex
<zid> hex is just binary written funny though bear in mind, each digit is 4 binary digits
<zid> so either work
<leg7> yeah that's how I use it
<leg7> I just find that most of the time it should be written in a different base
<leg7> because you're going to be converting it so there wasn't really much point in writing it hex besides making it concise
<zid> should be?
<leg7> and avoiding errors maybe
<leg7> What is octal good for?
<zid> for values that express things in groups of 3 bits
<leg7> like linux perms
<zid> unix file permissions is on-
<zid> which is why chmod takes an octal value
<leg7> yeah makes sense
netbsduser has joined #osdev
<leg7> are there cpus that don't use interrupts?
<zid> sure, just don't connect the interrupt pins to things
<zid> pretty sure every microwave oven i've ever used has done this, given how shitty and unresponsive the buttons always are
<zid> just gotta wait for it to poll
<wantyapps> zid: ROFL
<leg7> So the only alternative to interrupts is polling?
<zid> there's also telepathy
<zid> (results may vary)
<leg7> well quantum magic would work
<zid> we have that already it's called DMA
<leg7> I meant quantum entanglement
<zxrom> leg7, Quantum entanglement is bullshit, forget it.
<leg7> Why?
<gog> i'm in a box and im simultaenously dead and alive
<leg7> Should I bother setting up the 8259 pic or use the APIC straight away?
heat_ has joined #osdev
bitoff has joined #osdev
<heat_> 8259 pic
<heat_> it's drastically simpler and you won't need to mess with fucking ACPI
bitoff_ has joined #osdev
<zid> 8259 is nice and easy
bitoff has quit [Ping timeout: 255 seconds]
<zid> and works well enough even for pci-e
<zid> according to qemu
<gog> MADT
netbsduser has quit [Ping timeout: 256 seconds]
heat has joined #osdev
heat_ has quit [Read error: Connection reset by peer]
netbsduser has joined #osdev
CryptoDavid has joined #osdev
carbonfiber has joined #osdev
<pounce> qemu is poggers
<zid> pumas are qoggers
gog has left #osdev [byee]
kpel has joined #osdev
leg7 has quit [Ping timeout: 240 seconds]
<nikolar> You can't use 8259 and other cores though
<nikolar> You need apic for that
Turn_Left has joined #osdev
duckworld_ has joined #osdev
<heat> good
<heat> other cores are pessimal
<nikolar> Locks are PESSIMAL
<nikolar> we do cli here
Left_Turn has quit [Ping timeout: 260 seconds]
duckworld has quit [Ping timeout: 244 seconds]
<zid> other cores honestly slows down your main core significantly
<zid> from all the locking and ipis and stuff, just don't bother, way faster
duckworld_ is now known as duckworld
<heat> cache line bouncing is a fraud
<heat> they don't wnat you to look into it
<heat> i feel exhausted after saying awake all night watching ufc
<heat> totes worth it tho
kpel has quit [Quit: Leaving]
vykt has quit [Ping timeout: 252 seconds]
<nikolar> Lol
SGautam has quit [Quit: Connection closed for inactivity]
leg7 has joined #osdev
vdamewood has joined #osdev
xFCFFDFFFFEFFFAF has joined #osdev
<kof673> > [PDF] An Overview of the NetWare Operating System - USENIX www.usenix.net › library › proceedings › full_papers › minshall The hardware poll list is a regular, background, polling list > https://man.freebsd.org/cgi/man.cgi?query=polling
<bslsk05> ​www.usenix.net: USENIX | The Advanced Computing Systems Association
<bslsk05> ​man.freebsd.org: polling
<kof673> > when done properly, polling gives more control to the operating system on when and how to handle devices, with a number of advantages in terms of system respon-siveness and performance
<kof673> in particular, it supposedly is better under "heavy load" in any case, some osen have such features
<heat> yea
<heat> linux also supports polling on the storage stack
<heat> no idea if windows does
<kof673> > What is octal good for? https://en.wikipedia.org/wiki/36-bit_computing
<kof673> > CompuServe was launched using 36-bit PDP-10 computers in the late 1960s. It continued using PDP-10 and DECSYSTEM-10-compatible hardware and retired the service in the late 2000s. # there is a k&r c compiler, sort of hacked to compile on dos/windows/linux/etc. i believe, and you would then transfer the output and assemble on the target :D
<kof673> *on github kcc maybe? do not recall
<kof673> somewhere i read that is why it exists/was "ported", because compuserve was still using it at some point lol
zxrom has quit [Read error: Connection reset by peer]
<zid> Polling? In my kernel? It's more likely than you think!
zxrom has joined #osdev
<nikolar> Lol
<heat> polling is like the most micro-optimization feature one could add to a kernel
<zid> It makes sense for certain loads
<zid> a router maybe
<zid> or file server
<zid> where you'd rather not get 0 work done because you're getting 800 interrupts a second, and would rather just churn through an ever-lengthening backlog
<zid> 80000*
<heat> like storage polling makes sense if you have 100 nvmes hooked up and at 100% usage such that hogging the CPU for an extra bit makes sense just to avoid the interrupt churn
<zid> exactly
<zid> if load == 100%
<zid> then interrupts are a waste of time
<zid> interrupts are mainly useful for wakeup
<heat> it's basically a "i'm a hyperscaler and need this for a very very specific reason" feature
<kof673> 24-bit, 48-bit (DSPs) i guess too :D > http://chameleon.synth.net/english/developers/ the sdk has a simulator, works with wine, as does the sdk (command-line utils at least) > the only open DSP hardware in the world [*] [* around 2006] > The development tools are completely free and there are no strings attached
<bslsk05> ​chameleon.synth.net: Home of the Chameleon
<kof673> in any case, there are 2 "octal" systems with simulators :D
nanobot567 has joined #osdev
<bauen1> can someone give me a reality check ? I have an armv7m system, and if I run
<bauen1> can someone give me a reality check ? I have an armv7m system, and if I run 'bx r1' with r1 = 0x20003439 ; then the processor for the love of everything should NOT attempt to switch from Thumb mode to ARM mode, right ?
op has joined #osdev
craigo has joined #osdev
nanobot567 has quit [Ping timeout: 255 seconds]
CryptoDavid has quit [Quit: Connection closed for inactivity]
xenos1984 has quit [Ping timeout: 256 seconds]
xenos1984 has joined #osdev
masoudd has joined #osdev
nanobot567 has joined #osdev
xFCFFDFFFFEFFFAF has quit [Remote host closed the connection]
gog has joined #osdev
xFCFFDFFFFEFFFAF has joined #osdev
xenos1984 has quit [Ping timeout: 256 seconds]
<heat> is there a good term for "make something positive"
<heat> negativize sucks, positivize also sucks
<GeDaMo> Absolutize?
<leg7> pessimize
<leg7> optimize
<heat> GeDaMo, no, this is not a number
<heat> but negative cache dentry vs positive cache dentry
<bslsk05> ​dictionary.cambridge.org: OPTIMIZE | English meaning - Cambridge Dictionary
<GeDaMo> reveal, embody, materialize
<heat> hmm, good words, thanks
<GeDaMo> posit
<heat> this is a wordle moment
<GeDaMo> Wake up, zid! :P
nanobot567 has quit [Ping timeout: 272 seconds]
xenos1984 has joined #osdev
<bslsk05> ​'Why Is C SO Dangerous? #programming #coding #lowcode' by Low Level Learning (00:00:51)
<zid> heat: positive metaphrically or positive numerically?
<zid> (close after 3 seconds)
<heat> his explanation is wrong
<zid> yea he's an idiot, but the first one second is great
<zid> better comedian than anything else
<heat> ok so basically: the directory cache has positive entries (actual files) and negative entries (not files, basically THIS NAME IS NOT HERE)
<heat> so it's positive metaphorically
<zid> but
<zid> what computer wise makes them positive or negative
<heat> the presence of a file in the filesystem with that name
<zid> no
<zid> not what causes it
<zid> struct { ??? }
<heat> oh, it's just a flag
<zid> but it's not a sign bit?
<zid> it's literally just a flag?
<heat> yep
<zid> That's weird, grats
<heat> this has no relation with numbers at all
<zid> red and black
<heat> negative dentries basically just cache the absence of stuff
<zid> black dentries.
<zid> Rather than red dentries.
<heat> which is the exact opposite of a normal cache entry for most caches
<GeDaMo> "We searched but did not find"
nanobot567 has joined #osdev
<netbsduser> they have those in dragonfly bsd
<heat> don't they have them in every unix?
<netbsduser> negative entries not so often
<kof673> (paraphrase) "they were digging for the source of the water, but could not find it. they couldn't see because they were blind" [putrification is done in darkness lol]
<netbsduser> i think the BSD VFS is quite ugly and dragonfly does a much nicer job at it because they use namecache locking to carry out e.g. the lookup-and-if-negative-create which on other BSDs is done by having a special flag to lookup VFS op that keeps the directory locked
<netbsduser> or i might be thinking of rename
<netbsduser> whatever be it, i don't care for the 4.4bsd vfs much, they introduced innovations which diluted the cleanness of the vfs as it was in solaris, which it's roughly copied from, but with horrible complicated new locking protocols and the use of the `lock` vnode op for kernel synchronisation purposes rather than just for file locking
nanobot567 has quit [Ping timeout: 256 seconds]
<leg7> heat you could name the flag `cached`
<leg7> or `treated`
<leg7> known
<leg7> exists
<heat> i dont need a name for the flag, i need a name for the verb
<kazinsal> "confirm"
<GeDaMo> potentiate
<zid> what action are you performing
<heat> turning a negative dentry into a positive dentry by the means of creating something at that location
<zid> flipping
<zid> is nice and generic
<heat> flip is good
<heat> i also liked materialize
<zid> please like it less
<bslsk05> ​i.imgur.com <no title>
<heat> i agree
<Ermine> meow
* Ermine writes down the idea of caching absence of something
<heat> it's super required for unix filesystem performance, cuz of all the silly queries for shit that doesn't exist
<heat> locally other caching may somewhat save you, remotely you're dead in the water
<Ermine> Are that many queries that get enoent response?
<heat> yes
<heat> for a quick test just do "command_that_totally_doesnt_exist" in your shell and watch it try to stat for it for every path in $PATH
<heat> with strace ofc. or just compile a program in gcc and watch it access() or stat() a bunch of include paths looking for your include
<Ermine> i saw that behaviour in musl execp*
<Ermine> i see now
xFCFFDFFFFEFFFAF has quit [Read error: Connection reset by peer]
<kof673> IMO at some level conceptually/metaphorically if it was memoization, say void * lookup(int a) you would surely memoize all results, not just the non-NULL ones etc.
<kof673> i don't think it is that strange anyways, just approached from another angle may seem like it is
<heat> well, that's exactly what you do
<heat> you cache valid results and you cache ENOENTs (other results are tricky to cache cuz they may be transient)
<kof673> well transience is a separate issue, but makes sense
<kof673> was just replying to that > writes down the idea of caching absence of something
<Ermine> so open(O_CREAT) should invalidate the cache?
<Ermine> or the entry
<heat> no!
<heat> say the dentry is something like
<heat> struct dentry {unsigned int flags; struct inode *inode;};
<heat> O_CREAT sees the negative dentry, creates the entry in-filesystem and does "dent->inode = new_inode; dent->flags &= ~DENTRY_NEGATIVE;"
<heat> done, converted to positive dentry, ezpz
<Ermine> z
<heat> it saves me a bunch of work too, cuz you had to create a positive dentry anyway
<Ermine> ah, i see
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gbowne1 has joined #osdev
gbowne1 has quit [Remote host closed the connection]
gbowne1 has joined #osdev
heat_ has joined #osdev
heat has quit [Read error: Connection reset by peer]
devurandom has quit [Ping timeout: 264 seconds]
devurandom has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
<leg7> Can someone share their IDT ISR implementation?
GeDaMo has quit [Quit: That's it, you people have stood in my way long enough! I'm going to clown college!]
<geist> the IDT itself, or the implementation of the handlers?
<geist> https://github.com/littlekernel/lk/blob/master/arch/x86/32/exceptions.S stamps out 256 of them and fills in an IDT pointing to them all
<bslsk05> ​github.com: lk/arch/x86/32/exceptions.S at master · littlekernel/lk · GitHub
<leg7> the idt itself I wrote in C earlier
<leg7> I would like to know how to fill it up with isrs now
<geist> then only the top part is of your concern
<geist> that code does the standard thing: for every vector it implements a 2 or 3 instruction stub that pushes the interrupt number and then branches to a shared piece of code
xenos1984 has joined #osdev
<geist> which pushes all the state and then calls into C code (x86_exception_handler)
<geist> if you're not familiar with gnu assembly, the trick is https://github.com/littlekernel/lk/blob/master/arch/x86/32/exceptions.S#L22
<bslsk05> ​github.com: lk/arch/x86/32/exceptions.S at master · littlekernel/lk · GitHub
<geist> that repeats the stamping out of that macro 256 times
<geist> in this case, since every entry point is 16 byte aligned, the code that later fills in the IDT can just start at the base of the vectors and add 16 for each of them
<leg7> What macro is it repeating
<geist> everything between rept and endr
<leg7> ok
<geist> sorry it's not a macro
<zid> either push i jmp, or push 0 push i jmp
<geist> it just stamps out that body 256 times
<zid> for exception vs interrupt
<geist> yep that's what that if statement at line 25 is
<zid> push %0 rather, argument 0
<zid> not an actual 0
<geist> it skips pushing an extra zero. this way when you get to the C code there's a consistent iframe
<zid> or maybe I read it wrong cus at&t idk
<leg7> gas is so bad omg
<bslsk05> ​github.com: lk/arch/x86/include/arch/x86.h at master · littlekernel/lk · GitHub
<geist> is the iframe that endsup being pushed
<geist> $ means constant
<zid> ah okay so it is an actual 0
<zid> so that you have a consistent frame and it's just padding, right
<geist> and yeah the other trick as i was saying is it aligns each of those on a 16 byte boundary, so the IDT code that fills it in later can just for offset = 0, offset += 16
<geist> i used to have the vaneers packed in but the problem is due to the codegen and whatnot they're not a consistent size
<geist> and the amount of code later to manually fill in every vector is greater than just adding the padding
<geist> and the padding nicely aligns things for performance purposes anyway
<zid> I wonder if push rax would be better because smaller
<zid> or worse because it might stall a bit sometimes
<geist> cant because we haven't saved rax at this point
<geist> so can't use any registers
<zid> you're only pushing it, as a dummy value, it doesn't 'use' it
<geist> ah i see what you mean. nah i think the push 0 is pretty small
<geist> anything < 0x80 ends up being like a 2 byte instruction i think
<geist> it's when it goes over 0x80 that it switches to a 4 byte constant
<geist> there's a push imm8 form
<geist> this was a bug that heat hadn pointed out to me a few months ago, because the vaneers for vectors >= 0x80 were 4 bytes longer and i hadn't reserved enough space in the alignment
<zid> oh yea it's literally 6A
<zid> pushsx :P
<leg7> I need to handle interrupts to get PS/2 kb input right?
<zid> not if you don't use interrupts, yes if yes
<geist> if you're willing to poll, no
<zid> no if no
<geist> but you'll want interrupts soon enough for timers too
<zid> I still don't have timers, cus I don't have that kind of task switching
<leg7> wouldn't polling involve a timer that uses interrupts?
<geist> generally getting interrupts working, at least trapping things and dumping a "i fucked up heres the regs" is about the second thing i'd do
<geist> which is about where you're at
<zid> leg7: insteadof while(1) hlt();
<zid> you do while(1) { check_keyboard(); check_ethernet(); check_...(); }
<zid> a timer interrupt would stop it catching fire, but isn't needed
<zid> not that we're recommending it
<zid> just add interrupts
<geist> but like i said at least catching all the exceptions and halting the system is pretty good at this point
<zid> It's actually really eas
<geist> since you'll be able to debug other failures
<Ermine> geist: I guess you can't make IDT in C like you did arm vectab?
<zid> You do 11 magic outbs, and fill out a table and execute lidt
<zid> done
<zid> The table is like the gdt but way way simpler
<leg7> yeah I didn't plan to skip interrupts I was just reading the osdev wiki and it didn' really mention you need interrupts for ps/2
<geist> Ermine: I could. i did it in asm because it branches to it very very early before C is even ready
<zid> I mean, you don't, unless you want interrupt driven ps/2
<geist> really i wish i could hard code it, but that's a limitation of ELF and whatnot
<geist> since the base address is split across two fields, the linker can't handle that
<geist> in both asm and C you can't do something like
<zid> can you not add a relocation type for it? :D
<zid> HI() and LO() and stuff sometimes exist to generate those etc
<geist> yeah but they dont exist for x86
<zid> rip
<zid> time to port binutils and add a custom reloc
<geist> wel, ctualy one of the issues is LK also compiles with clang and links with lld, and those tend to be a bit pickier
<geist> a bit less easy to badger those tools to weird places
<geist> they'r emore by the book
<zid> I just use attribute__((interrupt)) which actually works on x86 now!
<geist> i do that for a few of the arches i haven't put much time into, but they all have a fatal flaw
<geist> you can't get an iframe from then, because they just pushed whatever on the stack it needs
<geist> it's nice for quick n dirty ports, but it falls apart super fast
<zid> it'd work if you had a kernel stack per thing that could interrupt though right? just put away the stack page along with the stack pointer etc. I assume the reason you want to know how much of the stack is used etc is so you can inspect it
<geist> it's all about having a consistent frame so you can dump the state on error
<zid> disregard errors
<geist> it's per arch, but the arches where the compiler has it they just dump what they need to
<geist> it's true if you disregard errors it's a convenient and probably fairly efficient way to handle the state dump
<zid> the amd64 one at least is hardcoded and I know what it does.. I could cheat that way
<zid> it always pushes r11, r10, r9, r8, rdi, rsi, rcx, rdx, rax in that order
<zid> oh right, boo
<geist> but at this point i actually want to really press upon leg7 the notion that they (preferred pronoun?) need to build up the debuggability so it can accellerate future development
<zid> It *doesn't* push r15, because it wasn't used in what was called-into, as as 'optimization'
<zid> I see exactly what you mean now
<zid> It'd be nice if there was an option for that
<geist> yah i think it basically pushes the temp registers, and then the rest as needed
<zid> yea it just pushes the sysv-abi regs
<zid> oh wait, no
<zid> r15 is callee saved, so they *won't* corrupt it
<zid> this should be fine in all cases
<geist> indede. though of course depending on that layout is a Bad Idea
<heat_> yeah when doing an arch port trap handling is like... the second thing i deal with, right after getting a bare bones boot environment
<zid> yea it's not.. ideal
<zid> but it should be so robust that most other things will break before it tbh
<geist> also its per arch and per compiler. no idea if clang or whatnot implements that yet
<zid> amd64 attribute interrupt isn't exactly getting a lot of churn
<zid> yea the main issue is wtf do you do on other compilers
<geist> well, except AFAIK it wasn't implemented a few years ago
<zid> buut you might end up with 'other assemblers' in the case, so it's not like doing it in inline assembly is going to work either
<heat_> i do roughly early mmu -> early boot env -> traps -> actual mmu and then add things as the need arises
<geist> sort of. on arches that implement attribute((naked)) you can do it in C
<zid> so imo interrupt entry code is probably pretty heavily tied to compiler/assembler/binutils combo enough that you could probably just rely on this *in the gcc case*
<heat_> eventually jumping to interrupts for scheduling and/or userspace
<geist> but in that case you're just using inline asm instead of putting it in an .S file
<zid> yea this is just "my inline asm impl. is attribute interrupt"
<geist> heat_: yah asically
<geist> i should formally name it like stage 1 stage 2 stage 3 or something, since various ports in LK are in various places
<zid> if clang doesn't support it then clang can get its own inline for its weird plan9 syntax
<geist> like for example, microblaze (i'm thtinking about deleting it since its not really used anywhere) uses the attribute interrupt
<bslsk05> ​github.com: lk/arch/microblaze/exceptions.c at master · littlekernel/lk · GitHub
<zid> geist: stage 2 should be called warp, 3 should be for work groups
<geist> though somewhat as you'd expect, the cisc architectures are generally much easier to write exception handlers for: https://github.com/littlekernel/lk/blob/master/arch/m68k/exceptions_asm.S#L18
<bslsk05> ​github.com: lk/arch/m68k/exceptions_asm.S at master · littlekernel/lk · GitHub
<leg7> I'm a dude
<geist> push and go
<geist> leg7: cool, i just dont like to assume pronouns
<leg7> yeah
<heat_> least texan texan
<leg7> I got a pretty comfy debugging setup
navi has quit [Quit: WeeChat 4.2.1]
<leg7> rn
<geist> i saw that, i've only seen that level of gdb + qemu set up with i think doug16k
<heat_> what level?
<geist> it's over 9000
<leg7> I automated everything so I just need to open the debugger and set a breakpoint
<leg7> tbh the gdb gui is doing the heavy lifting it's so nice
<heat_> i also have gdb, i just barely use it
<heat_> except for inspecting crash state
<heat_> i do that pretty often
<geist> yah same. i dont use gdb at all, but if other folks put the time in to get it going, good for them
<leg7> you should try the gui I use it'll make you use it all the time
<zid> heat_: He's very open minded, he don't care if you're a trans girl, trans boy, or normal.
<zid> *redneck by red truck jpg*
<heat_> lmao
<heat_> leg7, no, i have like literally 0 use for gdb
<heat_> it doesn't work when you add scheduling, it doesn't work when you add SMP
<zid> I use gef it's great :p
<geist> wel i mean just new people to the channel i never assume pronoun until either they use it themselves, say something, or eventually i just ask
<bslsk05> ​nakst/gf - A GDB frontend for Linux. (42 forks/1420 stargazers/MIT)
<heat_> and most importantly you don't have gdb in real hardware
<heat_> printf is goated
<heat_> or, if you're fancy, an actual tracing interface
<Ermine> printk
<geist> agreed, Back In My Day we didn't have emulators
<geist> you wrote the shit to a floppy disk and booted it
<bslsk05> ​gitlab.com: nakst / essence · GitLab
<geist> if you were fancy you hooked up a com port
<geist> (actually that's almost mandatory, since real PCs have a tendency to triple fault and clear the screen)
<Ermine> My first success in editing linux sources was making it swear in some places
<geist> my usual i dunno where it's failing thing is to just put in an infinite loop and then binary search for where it goes off in the weeds
<Ermine> (I was figuring out why goodix driver stopped working for my touchscreen)
<geist> but yeah i guess GDB would be noice sometimes
<zid> gef is the tits
<heat_> Ermine, oh yeah i've just used printk("fuck") and panic("fuck")
<leg7> Is this channel bridged with discord?
<heat_> no
<zid> godno
<leg7> ok I just see discord links
<zid> That's a link to a picture
<zid> of gef
<Ermine> I've printed fuck $exit_code or fuck $funcname
<zid> I usually use the serial port cus printk is easy to not be able to see
<leg7> yeah I thought maybe you were on discord and uploaded the image and I just see the link
<zid> my playstation debugging is all printfs over the serial port
<Ermine> but why panic("fuck")?
<zid> heat_: do u liek my debuger?
<zid> other than the fact for some reason the stack isn't showing
<leg7> isn't it just gdb tui?
<zid> it's gef
<leg7> when you type `layout asm`
<zid> it's some big python repl thing over gdb
<zid> with a bunch of built ins for doing debuggering
<zid> it can spit out pwntools scripts and other weird things
<heat_> Ermine, because usually my problems are too complex for an 80x25 screen
<zid> That's why I use 6 of them, heat
<leg7> lol
* geist-sdf yawns
xFCFFDFFFFEFFFAF has joined #osdev
<heat_> i hate refcounting i swear
<geist-sdf> agreed
<heat_> https://i.imgur.com/BwwM1WS.png this is what i mean
<bslsk05> ​i.imgur.com <no title>
<heat_> gdb will not help at all
<heat_> i have hundreds of file system operations per boot, and my boots are pretty simple
<zid> file kernel.bin file <whatever process is running>, throw a breakpoint on the 'killing cpus' line, gg
<zid> but yea, debuggering that isn't a debugger job
<zid> it's a FLAMEGRAPH job
<leg7> What is refcounting?
<zid> counting references
<bslsk05> ​catb.org: Some AI Koans
<heat_> literally what zid said
<kof673> Moon instructs a student
<leg7> duh in what context
<zid> thing cab be free
<zid> when no more reference to thing
<zid> how do you know no more refernece? count them.
<zid> i.e if I tell you to delete a file, but file has 3 people with file open, I know I can actually delete file when 0 people have file open
<leg7> oh ok
<zid> I need to count to 3 to know this
<zid> heat_: Have you considered adapting rfc-2322?
<Ermine> nonetheless, stopping windows by attaching kd is fun
<Ermine> supposedly there are more useful ways to use kd
carbonfiber has quit [Quit: Connection closed for inactivity]
<bslsk05> ​www.reddit.com <no title>
[Kalisto] has quit [Quit: No' vemo']
[Kalisto] has joined #osdev
<heat_> i oopsied my namei code into creating a file with a / in it
<nikolapdp> lol
<gog> oopsie doodle
<heat_> anyway NEGATIVE DENTRIES!
<nikolapdp> does it show up when you ls or something
<heat_> and refactored a bunch of shit and i think i fixed some more namei tests
<heat_> nikolapdp, yep
<nikolapdp> lol nice
<wantyapps> Yay I got a shell working :)
<geist> i've neer completely figured it out but i think some shells prune things out of the path too
<geist> i've seen situations where a path comes into existance where PATH points, and the shell wont pick it up
<geist> so presumably it keeps a list of dirs that it wont even try next time
<heat_> there's a cache in most shells, but it's a positive cache only
<nikolapdp> you need to hash -r to update usually
<geist> ah, TIL!
<heat_> but this does mean that if it gets a hit and then you change PATH, it probably won't pick it up
<heat_> unless you hash -r
<geist> yah actuall i think it happens when you add some sort of overriding thing in /usr/local/bin or something, and it doesn't pick up the new one
<geist> hash -r, that's useful. i aways just restart the shell
<clever> bash will also rehash if you `export PATH=$PATH`
<clever> even though its a no-op, bash still considers it a change
<nikolapdp> you're welcome geist :)
<heat_> iirc hash -r can take an optional argument just to invalidate a single command
<geist> i've seen hash -r before, i just never bothered to look at what it does
<heat_> doing just 'hash' prints the hash table
<geist-sdf> pretty neat
<clever> oh, neat!
<heat_> shellz
op has quit [Remote host closed the connection]
<heat_> i hate unix so so so fucking much jesus
<nikolapdp> why are you writing one then
<heat_> i have 2000 lines of confusing path walking
<heat_> stockholm syndrome at&t version
<nikolapdp> lol
<kof673> 1) csh i think has "rehash" 2) Bill Gates and Paul Allen originally wrote Altair BASIC using an Intel 8080 simulator running on a PDP-10 at Harvard University. Allen repurposed the PDP-10 assembler as a cross assembler for the 8080 chip.
<kof673> anyway, i think kcc sort of works to output assembly...but not sure if cross-assembler + linker exist or not...
<kof673> found that when looking lol
<heat_> nikolapdp, if you ever want to find out horrible corner cases in path walking just see my namei.c
<heat_> it found problems in every UNIX
<kof673> > the cancellation of the PDP-10 line was announced in 1983 compuserve kept going another 20 years or so lol
<geist> note there's a new rpi based pdp-10 emulator nearly ready for mass consumption
<bslsk05> ​pidp.net: PiDP-10
<nikolapdp> heat_ that sounds thrilling
<heat_> it's AWFUL
<heat_> funny to test, horrible to implement
<kof673> > The KA10 weighs about 1,920 pounds anyways...
<heat_> and above all i hate hate hate hate hate hate rename
<geist> that was kinda where i got with newos, it started to get more into the esoterica of posixy stuff and my interest waned
<heat_> fuck rename
<geist> and that was 25 years ago, when libc was much more straightforward to implement and unix wasn't as complicated
<nikolapdp> yeah rip
<heat_> i dont find posix fun to implement at all
<heat_> and it's normal, because it's hairy and is basically "what this old unix code did, but text form"
<nikolapdp> when i get around to writing my own os, posix support is going to be best effort, ie don't expect corner cases to be correct
<geist> right
<heat_> tty semantics were super ad-hoc
<heat_> fortunately most of POSIX is easy enough that it doesn't get in the way
<heat_> like, mmap is mmap
<nikolapdp> yeah but i won't be bothering with special handling for symlinks or whatever other edge cases there are
<nikolapdp> screw that
<heat_> did you know
<heat_> open("broken_symlink", O_CREAT) repairs your broken symlink
<nikolapdp> lol how
<heat_> posix defines path walking with symlinks to be more or less "as if the two paths were concatenated"
<heat_> so it ends up having the broken target as the last path segment and just... creates it
JTL has quit [Quit: .]
<nikolapdp> cursed
JTL has joined #osdev
<heat_> also when creating a file the permissions don't really apply
<heat_> eg you can create a read-only file but open it O_RDWR first time
<nikolapdp> i mean kind of makes sense
<nikolapdp> got to initialize it first
<nikolapdp> i guess
xFCFFDFFFFEFFFAF has quit [Read error: Connection reset by peer]
Turn_Left has quit [Read error: Connection reset by peer]
<clever> heat_: i can see that being useful, to initialize a file, and prevent any other process from messing with it
<heat_> that doesn't make much unix sense
<heat_> like why is your process afraid of other processes running under your user
<geist> becuse everyone is kung fu fighting
<clever> and the O_CREATE flag kind of prevents the same kind of clash
nikolapdp has quit [Remote host closed the connection]
<clever> you cant both open the same new file at once
nikolapdp has joined #osdev
<nikolapdp> reminder to not paste non ascii stuff into pdp-11 lol
<heat_> not-america moment lmao
<clever> i remember a trick about the c64, the string compare routine, will just xor the 2 chars together i think, and then check bit7
<nikolapdp> D
<nikolapdp> lol
<clever> and the strings in the rom are terminated by having bit7 set on the last char
<nikolar> oh yeah for the basic right
<clever> so `(a ^ b) == 0x80` means its both the final char and it matches
<clever> but, if bit7 is set on the last character of the user-supplied input character, it terminates the search early
<nikolapdp> that's also why you can use shorthands for basic keywords lol
<clever> nikolar: and yep, by using shift or something, on the r in `pr`, you can kinda auto-complete `print`
<clever> yep
<nikolapdp> kind of neat "feature" lol
<clever> one mans bug is another mans feature!
<nikolapdp> exactly
<heat_> one mans linux is another mans kernel
<bslsk05> ​imgur.com: Imgur: The magic of the Internet
nanobot567 has joined #osdev
leg7 has quit [Ping timeout: 260 seconds]
heat_ has quit [Remote host closed the connection]
<netbsduser> heat: gdb works fine with SMP
leg7 has joined #osdev
leg7 has quit [Ping timeout: 255 seconds]
carbonfiber has joined #osdev
nanobot567 has quit [Ping timeout: 272 seconds]