Search logs:

channel logs for 2004 - 2010 are archived at http://tunes.org/~nef/logs/old/ ·· can't be searched

#osdev2 = #osdev @ Libera from 23may2021 to present

#osdev @ OPN/FreeNode from 3apr2001 to 23may2021

all other channels are on OPN/FreeNode from 2004 to present


http://bespin.org/~qz/search/?view=1&c=osdev2&y=24&m=4&d=13

Saturday, 13 April 2024

00:00:00 <mcrod> chaos is coming
00:00:00 <mcrod> don't worry
00:06:00 <heat> geist: O0 is funny. for clang it basically makes it into a braindead compiler
00:06:00 <heat> gcc is less stupid but still bad codegen overall
00:06:00 <heat> but for clang you can have something like "int foo(){int a = 10; return 20;}" and it'll create a stack frame, store 10, undo the stack frame, return 20
00:07:00 <geist> yah that's why i say just having a simple pass to get the basics is pretty useful
00:07:00 <heat> wow okay even gcc is doing it in this case
00:08:00 <geist> that was pretty much my experience, i just didnt feel like arguing a while ago
00:08:00 <Mondenkind> can't you tell llvm to specifically run some passes?
00:08:00 <heat> probably
00:08:00 <Mondenkind> mem2reg would do what you want here i think
00:08:00 <heat> not sure, the variable is unused
00:09:00 <heat> you don't need a mega-optimizer to look at this and say "oh wow this is not used at all"
00:09:00 <Mondenkind> mmm yeah but it would at least get rid of the memory accesses
00:09:00 <geist> right just simple dead code removal and expression collapsing
00:09:00 <Mondenkind> which are gonna probably be most of what kills you most of the time
00:09:00 <Mondenkind> probably most code isn't dead until you do other optimisations
00:09:00 <heat> i would probably need to run opt with mem2reg
00:09:00 <Mondenkind> so i doubt _just_ dce would buy you much for most code
00:10:00 <geist> i think the idea of assigning everyhting a stack slot and load/storing it is so that simple debuggers always have a reference to the variable
00:10:00 <geist> its here, on the stack, at slot X
00:10:00 <heat> what are these "simple debuggers" and are they in the room with us tonight
00:10:00 <Mondenkind> in llvm's case it's just because clang intentionally emits braindead code for simplicity knowing it will be cleaned up later
00:10:00 <Mondenkind> which is reasonable engineering wise, tbh
00:11:00 <heat> well yes it is llvm's fault
00:11:00 <heat> llvm O0 is drastically clunky
00:11:00 <heat> what really annoys me is that cc defaults to O0
00:12:00 <heat> you can't do $(CC) *.c -o prog without adding a bunch of reasonable compile flags
00:12:00 <heat> because reasonable defaults are unreasonable
00:12:00 <geist> well, sure you can, and in a lot of cases prog works fine
00:12:00 <geist> it's just PESSIMAL
00:12:00 <geist> which most people dont care
00:13:00 <geist> so default to the fastest compile, with most debuggability
00:15:00 <heat> it's probably minimally pessimal because CPUs are maximally great at everything
00:16:00 <heat> except not having large chunks of microarchitectural state leak. they're not great at that
01:31:00 <chiselfuse> https://wiki.osdev.org/Emulator_Comparison
01:31:00 <bslsk05> ​wiki.osdev.org: Emulator Comparison - OSDev Wiki
01:31:00 <chiselfuse> if we were to add Simics to this table, what would it have under the "Method" field?
01:33:00 <chiselfuse> i wonder why it's not listed
01:33:00 <chiselfuse> https://www.cs.cmu.edu/~410/doc/enthusiast.html
01:33:00 <bslsk05> ​www.cs.cmu.edu: 15-410 Documentation For The Enthusiast
01:33:00 <chiselfuse> i found this mentioning:
01:33:00 <chiselfuse> > QEMU obtains better performance than single-instruction intepreters such as Bochs or sub-instruction simulators such as Simics...
01:33:00 <chiselfuse> but i'm not sure what this means
01:59:00 <geist> it's because qemu translates runs of instructions into the native instruction set
01:59:00 <geist> bochs interprets each instruction one at a time
01:59:00 <geist> and simics is i guess trying to emulate the full microarchitecture of the cpu
02:00:00 <geist> though qemu doesn't really get near 1:1 performance, it's not too bad because of this translation effect, and it it not being a single instruction at a time
07:35:00 <chiselfuse> geist: i find no difference between what you suspected about bochs vs what you suspected about simics
07:35:00 <chiselfuse> if bochs tries executes instr by instr then it must be emulating the microarch
07:35:00 <geist> well, not exactly. an instruction at a time is not really emulating the stages of how a cpu would execute instructions
07:36:00 <geist> simics, i dunno much about it, may be doing sub instruction emulation, like the pipeline of the instructions
07:36:00 <geist> to get perhaps perfect timing
07:36:00 <gog> hi
07:38:00 <chiselfuse> hello
07:38:00 <geist> a gog!
07:38:00 <geist> good morning gog
07:39:00 <chiselfuse> geist: how about qemu? you said bochs does it instr by instr, does qemu do it by instr batch then? :P
07:39:00 <geist> it dynamically translates instructions to the host
07:39:00 <geist> and in runs of instructions
07:39:00 <Mutabah> or uses the host CPU's VM extensions
07:39:00 <chiselfuse> geist: wouldn't that be letting the host execute code of the guest instr by instr?
07:40:00 <geist> i'm assuming the host is not the same architecture
07:40:00 <geist> and indeed, if it's the same architecture and the host OS allows it, QEMU also serves as a virtual machine host
07:40:00 <geist> in which case the code is indeed running at full speed
07:42:00 <Mutabah> chiselfuse: qemu is usually a JIT - it converts blocks of code into host native instructions, then gets the host to run that block of code.
07:42:00 <Mutabah> in contrast to a simulator like bochs, that is a massive `switch` statement on the opcodes
07:43:00 <chiselfuse> Mutabah: switch to what? say i have `add eax, 5` on guest, can you give example for this?
07:44:00 <chiselfuse> just try to execute equivalent instr on host you mean?
07:45:00 <Mutabah> bochs would have something like `switch(opcode_byte) { case ADD_IMM_AX: regs->EAX += 5; update_flags(); break; ... }`
07:45:00 <Mutabah> while qemu would generate a block of native code that does the same thing, then jump to it
07:46:00 <Mutabah> the trick with qemu is that it translates lots of instructions in a go - maybe up to the next jump instruction, and then runs them in one batch.
07:46:00 <Mutabah> so, there's less overhead deciding what instruction needs to be run, and it can reuse that code generation if that same block is run again
07:47:00 <geist> and it's a block of code, in that it'll translate a run of instructions until it gets to some point where it has to make a decision
07:47:00 <Mutabah> (huh, that code would be `05 05`)
07:48:00 <Mutabah> sorry, `05 05 00 00 00` - forgot the zero bytes
07:49:00 <Mutabah> and really fancy JIT VMs like that can optimise the translated code, to remove unneeded calls - e.g. avoid updating flags if they aren't used.
07:49:00 <chiselfuse> i wonder if this Simics emulates the processors exactly with all possible hidden undocumented things
07:49:00 <chiselfuse> since intel develops it now
07:50:00 <chiselfuse> Mutabah: do you know instruction encodings by heart?
07:50:00 <Mutabah> No, I opened an emulator project I was working on ealier
07:50:00 <geist> yah i have written a few, but nothing recent
07:52:00 <chiselfuse> do you think i can get the full Simics?
07:52:00 <chiselfuse> they ask you to email them for that as far as i can tell
08:03:00 <geist> good question
08:03:00 <geist> *probably* not but it doesn't hurt to ask
09:28:00 <mjg> have you NERDS seen the fallout tv show?
09:29:00 <gog> i'm not a nerd
09:29:00 <mjg> 's why i was not asking you mate
09:29:00 <mjg> anyhow i'm 6 episodes in (out of 8) and it is pretty decent
09:29:00 <gog> maybe we'll have to put it on our list
09:30:00 <gog> i've heard it's good
09:30:00 <mjg> from what i read on the interwebz people who are really into the franchise like it
09:30:00 <mjg> personally i only played fallout 1 and 2, and even then it was liek 20 years ago
09:30:00 <gog> i've only really played new vegas
09:30:00 <gog> but i love it
09:30:00 <gog> it's one of my fav games
09:30:00 <mjg> mon totally chheck out OG stuff
09:31:00 <mjg> you are old enough to be fine with 2d graphics
09:31:00 <mjg> :d
09:31:00 <gog> true
09:31:00 <mjg> anyhow they got the art style right afaics
09:31:00 <zid> I really like fo1, my friend really likes fo2, we do battle tomorrow at dawn
09:31:00 <gog> swordfighting in the denny's parking lot
09:31:00 <mjg> i have no idea how true it is to newer games
09:33:00 <gog> i've never played fo4
09:33:00 <gog> or 76
09:33:00 <zid> fo4 is weird, it's a nice little evolution on fo3's gunplay systems
09:33:00 <zid> but the story gets 3/4 of the way finished then just... stops
09:34:00 <zid> The big reveal is about to happen
09:34:00 <zid> then the guy who would reveal it doesn't, and it ends
09:36:00 <zid> so if people ask if they should play it I just say play it until you get bored of shooting things / building your rpg character, then stop
09:40:00 <zid> as we all know, the correct game to put lots of hours into is balatro
09:46:00 <gog> i lost a run on ante 7 this morning
09:46:00 <gog> i could only win with a flush of clubs
09:46:00 <zid> I lost to the final boss yesterday, whoopsie, I had a trash deck though
09:46:00 <zid> surprised it got as far as it did
09:47:00 <gog> yeh i was playing with a pretty bad set of jokers
09:47:00 <zid> I'm mainly just looking for my final legendary joker though to finish my collection tab
09:47:00 <gog> noice
09:47:00 <zid> I had erm, +1 mult per tarot, and stencil
09:47:00 <zid> :P
09:47:00 <zid> and didn't get any good celestial cards for the hand I was playing
09:47:00 <zid> so I was.. weak
09:47:00 <gog> oof
09:48:00 <zid> having to do things like hold justice in hand to pump store
09:48:00 <gog> stencil is good for like the first few rounds
09:48:00 <zid> stencil's kinda good midgame
09:48:00 <zid> early it's too weak imo because you have no flat +mult yet
09:48:00 <gog> true
09:48:00 <zid> midgame is good if you like, get a couple of good celestials for some flat, then pair it with say, 1 money joker and 1 mult joker
09:49:00 <zid> but if you don't get the celestials or a good money joker it.. rapidly murders you
09:49:00 <zid> I held on by the skin of my teeth to the final boss with some tricky tarot card banking
09:50:00 <zid> I've beaten all the challenges and unlocked everything now, except for 1 legendary joker (ironically, probably the best one)
09:50:00 <zid> and beaten gold stake on a deck
09:52:00 <gog> wow
10:16:00 <zid> if you suck you probably just have POOR MONEY MANAGEMENT
10:17:00 <gog> yes
10:17:00 <gog> i do IRL too'
10:18:00 <zid> Just get to 25 asap and stay above it and game is ez
10:18:00 <zid> and don't skip much
10:21:00 <FireFly> just win and it's easy to win
10:21:00 <zid> just forget to lose
10:21:00 <gog> never lose
10:21:00 <gog> losing is for losers
10:21:00 <gog> if you lose you're a loser
10:21:00 <gog> and that's a permanent condition you can never change
10:22:00 <zid> That's how I beat bosses in dark souls, just keep my hp above 0 duh
10:22:00 <gog> roll
10:22:00 <zid> rolling is MID
10:22:00 <gog> so am i
10:22:00 <zid> man, I wanna play sekiro again now
10:33:00 <zid> hot tip btw, flushes are trivial to make and a flush with a couple of high cards gives just above 300 points, makes seeing the first shop trivia
10:34:00 <zid> then you can just restart if it's shit if you like
10:41:00 <gog> you need 75 points x4 for a flush to get you max monies
10:41:00 <gog> that's pretty easy
10:41:00 <zid> yup
10:41:00 <gog> a flush is 35x4
10:41:00 <zid> so you need 40 from the cards you played, two bigs and 3 littles
10:43:00 <heat> i fell asleep watching a video on my watch later playlist
10:43:00 <heat> woke up watching a vid about readahead
10:43:00 <heat> fuckin youtube (it's not youtube's fault)
10:49:00 <zid> gog: got an okay start
10:49:00 <zid> https://cdn.discordapp.com/attachments/1228658377287139408/1228658400037175376/image.png?ex=662cd84d&is=661a634d&hm=bfa5b1f5236b9d5117c8cf64426745b640764a9a2e6fd00a5f931c0388c36b7b&
10:50:00 <zid> polychrome baron = lol
10:50:00 <gog> ooh
10:50:00 <gog> that's a good fucken joker
10:50:00 <heat> what is this, poker for nerds?
10:50:00 <gog> heat: yes
10:50:00 <zid> with burnt joker too so I can upgrade high card once per round
10:51:00 <gog> polychrome burnt joker
10:51:00 <zid> yep :D
10:51:00 <zid> haven't had a single hanged man though, rip
10:55:00 <zid> fuuck, legendary joker, wrong one
10:56:00 <gog> i need to write a heap impl
10:56:00 <gog> fuck me
10:56:00 <gog> every time i get somewhere i need to do something else
10:56:00 <heat> slab slab lab slab slab
10:56:00 <heat> slab
10:56:00 <heat> slab
10:57:00 <gog> slab deez
11:02:00 <zid> gog: https://cdn.discordapp.com/attachments/1228658377287139408/1228661627331809290/image.png?ex=662cdb4f&is=661a664f&hm=dbc2f440a4386eb21cb74e05f40d8edd5d7c01a325f05435cd08879905f7063a&
11:02:00 <zid> ez life
11:03:00 <gog> neat
11:05:00 <zid> LOL blueprint
11:07:00 <zid> 2nd legendary, got it, done, fuck yea
11:13:00 <netbsduser> what sort of heap gog
11:14:00 <gog> like malloc()/free()
11:14:00 <gog> memory heap
11:14:00 <netbsduser> who for?
11:14:00 <gog> myself
11:14:00 <gog> NIH
11:15:00 <heat> slab slab slab slab slab slab
11:15:00 <heat> or slub
11:15:00 <heat> slub slub slub slub slub
11:15:00 <heat> slub on deez nutz
11:15:00 <netbsduser> what sort of code will consume it? i hate malloc() and free(), most programs could be more specific about what they need to allocate and they could provide the size at free-time
11:15:00 <gog> userspace code
11:16:00 <heat> wait, userspace?
11:16:00 <gog> USER SPACE HEAT
11:16:00 <heat> slab is probably not a great choice then
11:16:00 <zid> https://cdn.discordapp.com/attachments/1228658377287139408/1228665053121609737/image.png?ex=662cde80&is=661a6980&hm=d997e9681c067cfa95f010f3e63879aa83f79d5ced61e0c46d1926b855262758&
11:16:00 <zid> last pic gog
11:16:00 <netbsduser> if you're NIH'ing the userspace code too then you could expose a slab allocator (called the queen of kernel memory allocators) interface directly and make use of it
11:16:00 <gog> holy shit zid
11:16:00 <gog> yaaaas queen
11:17:00 <gog> heat i am not a slub
11:17:00 <gog> don't slub shame me
11:17:00 <zid> four steel kings with red seal pretty good with 4 copies of baron
11:17:00 <heat> slab is a horrible horrible choice for most userspace programs
11:17:00 <gog> i only have mmap() rn
11:17:00 <gog> but i don't need whoel pages
11:18:00 <gog> well, i do, but not for the specific thing i'm working on
11:18:00 <heat> slab is also called the queen of memory consumption, and that doesn't go hand-in-hand with userspace
11:19:00 <gog> no matter i have to start house cleaning anyway
12:00:00 <zid> mechanical pencils? In *MY* pencilcase? It's more likely than you think.
13:47:00 <mjg> i finished fallout (the show), 8.5/10 from me
13:47:00 <mjg> provided you accept the whacky comedy
15:58:00 <kof673> ACTION builds https://www-old.cs.utah.edu/flux/alchemy/cmi.html on freebsd 4.9 with ghc 6 package, verifies the knit binaries for freebsd 3.x run https://www-old.cs.utah.edu/flux/alchemy/software.html, and builds cmix statically http://www.ibiblio.org/pub/Linux/devel/lang/c/cmix.lsm, then verifies they all run inside 32M freebsd 5.4 read-only image https://web.archive.org/web/20050729010034/http://www.tinybsd.org/tinybsd/Download which runs in qemu
15:58:00 <bslsk05> ​www-old.cs.utah.edu: Alchemy: CMI
15:58:00 <bslsk05> ​www-old.cs.utah.edu: Alchemy: Software
15:58:00 <bslsk05> ​web.archive.org: Download - TinyBSD.org
15:59:00 <kof673> i don't think i will use knit, it has some kind of function renaming with elf but too fancy for me, but looked at it for "flattening" because i could not find cmi source until i found some backups
16:00:00 <kof673> then...can just make a build use scp stuff over (or nfs), run with ssh for example, and scp back the result (or nfs) lol
16:01:00 * Ermine slabs
16:02:00 <kof673> in any case, freebsd 3.x/4.x/5.x libc seems "interchangeable" at least for the above, symlink seems to work lol trying to build ghc is a pain, but that fbsd 4.9 package version works lol
16:06:00 <kof673> out of tinybsd/nanobsd/picobsd, > PicoBSD is a one floppy version of FreeBSD 3.0-current but alas, only runs static binaries, not sure ghc 6 has a package for that :/
16:07:00 <kof673> 32M is fine IMO, but linux maybe could make a smaller image easier
16:13:00 <kof673> *not sure ghc6 can run on any version of freebsd 3.x, to build binaries against freebsd 3.x libc
16:16:00 <mjg> dafaq you doin mate
16:16:00 <kof673> they are just useful for pre-lto c compilers lol
16:17:00 <kof673> still need to add some gcc to the 5.4 image for cmix to work, but the generated sources should all be "generic"
16:17:00 <kof673> you should be able to just pass pre-processed C89 from anywhere, they do there thing, and "transparent' to whatever target/libc/headers/etc. you use, so long as it is c89-ish
16:17:00 <kof673> *their
16:18:00 <kof673> cmix spits out a program, that generates the "reorganized" (specialized) source so it needs a c compiler, to compile source it generates, that simply generates "generic" source lol
16:19:00 <kof673> if not, might still work if your target is "close enough" lol
16:21:00 <kof673> well if you have dynamic linking or a way to load dynamic binaries/code...then you can get "specialized" code...so long as you write all the other pieces to make that happen, and have a way to invoke this at run-time etc.
16:22:00 <kof673> *assuming you only write c89
16:22:00 <kof673> :D
16:24:00 <kof673> modern toolchains should do everything cmi and knit "flattening" feature do, cmix is perhaps more useful (again, c89 only lol)
16:27:00 <kof673> cmix oversimplified just lets you say for a function such as foo(int a) make a specialized version for foo(3) (and propagate this further for whatever else foo() might call with that variable). so...it is just nice to have that done automatically without editing the source at all, "losslessly" and "transparent" in a sense, you just tell it what to "specialize" and it outputs transformed source
16:29:00 <kof673> so, one piece to slowly build up synthesis os-alike in C89 lol
16:30:00 <kof673> you still need a compiler of course, and some way to invoke that to compile the specialized code, and then load it, and tell whatever code to use that specialized version when possible
16:35:00 <kof673> knit let you do like pseudo-OO stuff with C, and oskit might have stuff like that (or use it) but you have to write fancy "makefiles" or whatever language it uses to specify "relationships"
16:36:00 <kof673> so it has fine-grained dependencies/build system but too much work IMO
16:37:00 <kof673> but theory is you could specify different "backends" whatever to implement a component, and the build system would handle that
16:37:00 <kof673> *my understanding, may be way off
16:38:00 <kof673> and stuff for initializing components in a required order, etc.
16:44:00 <gog> hi
16:44:00 <heat> gog
16:45:00 <gog> heat
16:49:00 <kof673> there is nothing special, just does ghc 6.0 build on modern systems? cmix is written in old c++...... it is easier just to use an old os to run them IMO
16:49:00 <kof673> so just having a VM to keep around is easier IMO
16:52:00 <kof673> (old at least) ghc needs old perl, and mangles the output assembly for tail calls, and wants like gcc 2.95 preferably IIRC...so just finding an old OS version that these programs build on is key IMO :)
16:53:00 <kof673> i would prefer wasm or something of course, but this will work in the meantime lol
17:03:00 <kof673> w2c2 (wasm to c89) i think is not quite c89 itself despite cliaming to be, not sure about the output, but cmi would be useful there for old compilers on old machines too
17:08:00 <kof673> or, ideally these "program transformation" programs would be a compiler plugin or something, and not target-specific, generic source code "transformers" :/
17:11:00 <Ermine> heat gog
17:11:00 <heat> Ermine
17:12:00 <gog> Ermine heat
17:12:00 <gog> c69
17:13:00 <heat> hehehe nice
17:13:00 <Ermine> the best language ever
17:19:00 <kof673> there was a person asking how to homebrew on ps1 a few days ago in another channel :D cmi is good if you are using old gcc, can even reduce code size substantially (you have 2M ram on psx normally lol)
18:17:00 <geist> gog Ermine heat
18:18:00 <heat> geist gog Ermine heat
18:18:00 <heat> rust 2069
18:19:00 <heat> i want to implement readahead
18:19:00 <heat> readahead sounds mysterious but the actual implementation of it (on linux at least, i dont imagine other unices to be too different) is super simple
18:27:00 <geist> hah cute: https://hackaday.com/2024/04/12/git-good-by-playing-a-gamified-version-of-git/
18:27:00 <bslsk05> ​hackaday.com: Git Good, By Playing A Gamified Version Of Git | Hackaday
18:28:00 <mjg> oh no
18:29:00 <heat> sorry i don't use git i use got
18:37:00 <geist> i haven't played it but it looks cute
18:40:00 <mjg> does it showcase legit uses though
18:40:00 <mjg> or does it facilitate the usual spaghettification of the repo
18:40:00 <mjg> really the biggest problem with git is protecting beginners from themselves
18:45:00 <geist> most of the beginner issues i've seen that are bad are not in the commits or how they do it, but in the local state. like starting a cherry pick, rebase, etc and then comtinung to work
18:45:00 <geist> the local index getting all fucked up
18:46:00 <mjg> dude
18:46:00 <mjg> total classic is the following: person makes a change on master, does git pull, that results in a spurious merge commit
18:46:00 <mjg> and they push that
18:47:00 <mjg> arguably does not make spaghetti, just garbage in git log
18:47:00 <geist> sure, but it's not fatal, it's just a silly merge commit
18:47:00 <geist> and yeah i 99% of the time force a rebase
18:47:00 <mjg> multiple by every person and every other commit they make
18:48:00 <geist> alas it's pretty much the default pattern on github with pulls
18:48:00 <mjg> i was part of a project so riddled with this shit i felt SAD
18:59:00 <Ermine> but does anybody use readahead?
19:00:00 <geist> i assume heat is talking about the fact that the OS silently readaheads for you
19:00:00 <geist> so that the data is already cached and ready to go
19:00:00 <Ermine> Ah, probably
19:01:00 <Ermine> I thought about its explicit version
19:01:00 <Ermine> Aand systemd dropped its support for quite a while ago
19:02:00 <mjg> makes you wonder how effective is it tho
19:03:00 <heat> how effective what is
19:03:00 <mjg> windows 98 on a modern pc
19:03:00 <heat> very
19:10:00 <geist> oh that's true, heat could have been talking about boot time readahead
19:10:00 <geist> i guess we'll never know. heat is an enigma
19:10:00 <kof673> > download_ghc_600 This is a Windows Installer for Microsoft Windows 95, 98, ME, NT, 2000 and XP cmix i don't know...i assume "cygwin" would be an easy "port" :)
19:10:00 <heat> i was talking about the automagic readahead yeah
19:10:00 <kof673> *cygwin/mingw/whatever
19:11:00 <Ermine> i wonder if virtio-gpu supports directx somehow
19:17:00 <heat> the vulkan one must
19:17:00 <Ermine> ?
19:32:00 <heat> ?
19:33:00 <Ermine> > the vulkan one must
19:36:00 <heat> whats the question
19:38:00 <geist> doesn't look like directly, but i suppose you could transliterate to vulkan or whatnot
20:14:00 <heat> yes
20:15:00 <heat> you can do gl over vulkan, dx over vulkan (DXVK), even sometimes gl over dx (ANGLE)
21:13:00 <leg7> yo
21:14:00 <leg7> I just made a GDT in order to manage interrupts and get user input but when I try to load the GDT my os crashes
21:14:00 <zid> whoopsie
21:15:00 <zid> also you need an IDT for interrupts
21:15:00 <leg7> I've tried debugging it but I'm not sure what to make of the qemu -d int output
21:15:00 <zid> does it crash on the lgdt, or afterwards?
21:15:00 <zid> post the -d int output somewhere would be useful
21:15:00 <leg7> I think it crashes when I reload the segments
21:15:00 <heat_> zid link your gdt decoder
21:15:00 <zid> shogun went down
21:15:00 <zid> I need to restore it somewhere else
21:17:00 <leg7> https://0x0.st/X-O7.txt
21:17:00 <zid> 🪱 Animal #257 🐕‍🦺
21:17:00 <zid> I figured it out in 3 guesses!
21:17:00 <zid> https://metazooa.com
21:17:00 <zid> 🟥🟥🟩
21:17:00 <zid> 🔥 2 | Avg. Guesses: 7
21:17:00 <zid> #metazooa
21:17:00 <zid> fuck
21:17:00 <bslsk05> ​metazooa.com: Metazooa
21:17:00 <zid> check_exception old: 0xffffffff new 0xd
21:17:00 <zid> 0: v=0d e=0000 i=0 cpl=0 IP=0008:0020043f pc=0020043f SP=0018:00206fc8 env->regs[R_EAX]=00000000
21:17:00 <heat_> lmfao what
21:17:00 <zid> That's the one we want, first exception
21:17:00 <zid> what's at 0x20043f
21:17:00 <zid> we took a gpf at that address
21:18:00 <leg7> So how do I read this?
21:18:00 <zid> you need to disassemble 0x20043f
21:18:00 <leg7> huhu
21:18:00 <zid> and tell me what instruction it is
21:18:00 <leg7> like break at that address?
21:19:00 <zid> -no-shutdown -no-reboot
21:19:00 <zid> x /1i 0x20043f I think is the qemu syntax?
21:19:00 <heat_> i use gdb
21:20:00 <leg7> I use gdb too
21:20:00 <leg7> it crashes at `mov ss, ax`
21:20:00 <leg7> when I reload the code segments
21:20:00 <zid> is that the first instruction after your jump label?
21:20:00 <zid> for jmp 8:pmode
21:20:00 <leg7> no
21:20:00 <leg7> I can push and send you the repo if you want
21:20:00 <leg7> it's pretty barebones
21:20:00 <zid> yea that works as long as it uses a sane build system
21:20:00 <leg7> I have a nix flake
21:20:00 <leg7> if you know what that is
21:21:00 <zid> not in the least
21:21:00 <leg7> is that a gigabrain way to say yes?
21:21:00 <zid> no, it means "Not even a little bit"
21:22:00 <heat_> nix is a build system and a package manager
21:22:00 <heat_> basically the worst of both worlds
21:22:00 <leg7> Ok sorry I'm not native
21:22:00 <leg7> I know "not in the slightest"
21:22:00 <leg7> and I thought that might be a refrence to that
21:22:00 <leg7> but the other way around
21:22:00 <leg7> anyways
21:22:00 <leg7> I only use nix to get the env setup
21:22:00 <zid> hmm why is emerge being fucky all of a sudden
21:22:00 <leg7> then it's a makefile
21:22:00 <zid> great, I like makefiles
21:23:00 <zid> and I can add -m32 where needed if needed or whatever
21:24:00 <zid> I have capstone in use flags, app-emulation/qemu capstone.. but no capstone for qemu
21:25:00 <leg7> https://github.com/leg7/LigmaOS/tree/gdt
21:25:00 <bslsk05> ​github.com: GitHub - leg7/LigmaOS at gdt
21:25:00 <zid> force masked, weird
21:26:00 <heat_> >ligmaos
21:26:00 <heat_> >chad pfp
21:26:00 <heat_> fuck
21:26:00 <leg7> yeah sorry
21:26:00 <leg7> not sorry
21:26:00 <zid> hardcoded gcc somewhere *finds*
21:27:00 <leg7> also the repo is huge because I have pdfs in docs you don't need to clone that
21:27:00 <leg7> if you can even not include it
21:27:00 <zid> well I'm already editing it to work on my machine, too late
21:27:00 <heat_> can you dump your gdt as an array of 64-bit words
21:27:00 <heat_> in hex
21:27:00 <leg7> can I do that with gdb?
21:27:00 <heat_> yes
21:28:00 <leg7> ok I'll figure it out brb
21:28:00 <heat_> x/gx yourgdt
21:28:00 <zid> capital K in kernel threw me there heh
21:28:00 <leg7> :)
21:30:00 <zid> crap what's the option for as for 32bit elf
21:30:00 <leg7> According to gdb my gdt is 0 >.<
21:30:00 <heat_> wat
21:31:00 <zid> heat halp
21:31:00 <zid> what is -melf_i386 but for ld
21:31:00 <zid> oh I can probaly --32
21:31:00 <zid> err for as
21:31:00 <heat_> idk
21:31:00 <leg7> if you use the nix flake it will just work
21:31:00 <leg7> :)
21:31:00 <heat_> wait, /gx doesn't work
21:32:00 <heat_> try
21:32:00 <heat_> x/Ngx where N is the number of entries
21:32:00 <zid> x /2gx gogo
21:33:00 <leg7> my gdb gui won't let me select and copy the output
21:33:00 <leg7> is there a way to redirect it to a file?
21:33:00 <leg7> the output of the command
21:33:00 <heat_> >gdb gui
21:33:00 <heat_> i swear is this a troll
21:33:00 <leg7> listen friend
21:33:00 <leg7> it's a good gui
21:34:00 <leg7> gf2
21:34:00 <heat_> i can take the ligmaOS but "gdb gui"? cmon
21:34:00 <leg7> the guy who made it made an operating system too
21:34:00 <zid> I have a boot/os.bin is that good
21:34:00 <leg7> yeah
21:34:00 <leg7> I use the iso
21:34:00 <heat_> is gf2 what you get when you can't get a normal gf
21:34:00 <leg7> do run with qemu
21:34:00 <leg7> you can do make run it will run it
21:34:00 <leg7> `make run`
21:35:00 <leg7> ig yeah
21:35:00 <zid> Too lazy to unbrick my qemu's disassembler
21:35:00 <zid> I mean, I could, but I don't have your tools or i386 qemu
21:35:00 <zid> soI will run it by hand like I've done everything else by hand
21:35:00 <leg7> https://0x0.st/X-VN.png
21:35:00 <zid> it was small enough that I could just use my system gcc with a shit load of flags
21:36:00 <zid> looks semi-sane at least
21:36:00 <heat_> is this 32-bit or 64-bit?
21:36:00 <leg7> 32
21:36:00 <leg7> if you use the nix flake it will just work
21:36:00 <zid> but that's what the gdtr points to right, and not what's loaded to it?
21:36:00 <zid> as mentioned, I have no clue what that is
21:36:00 <leg7> I explain it in the readme
21:37:00 <zid> lgdt [blah] blah: dw 24; dd gdt1 or whatever yea?
21:37:00 <leg7> it's what you end up using when you're tired of waiting for emerge on gentoo install n10
21:37:00 <zid> oh hey it worked
21:37:00 <zid> why would I wait, I have a cpu
21:37:00 <zid> https://cdn.discordapp.com/attachments/417023075348119556/1228821424752295976/image.png?ex=662d7022&is=661afb22&hm=7b7e2c6ec1853c86d6bed794bdc2b252318e7404891c947e28a835a535463072&
21:37:00 <zid> is this good
21:38:00 <heat_> ok zid i assume you have this
21:38:00 <heat_> good luck
21:38:00 <leg7> shit how do I copy paste in this
21:38:00 <zid> no gdt loaded though
21:38:00 <leg7> sorry for my clumsiness
21:38:00 <zid> wait, one is loaded
21:38:00 <leg7> first time using irc
21:38:00 <zid> v
21:38:00 <zid> GDT= 000cb2b4 00000027
21:38:00 <leg7> yeah that's what the os looks like
21:39:00 <zid> or is this the grub one
21:39:00 <zid> it's at a low address
21:39:00 <zid> I am at 94aeeb510, add vgatextmode
21:39:00 <heat_> https://github.com/heatd/hsd/blob/master/usr/sys/stand/gdt.c#L12-L28
21:39:00 <bslsk05> ​github.com: hsd/usr/sys/stand/gdt.c at master · heatd/hsd · GitHub
21:39:00 <heat_> leg7, make sure your gdt kinda looks like this
21:39:00 <leg7> well don't we have the adress of the gdt in the interrupt dump I posted?
21:39:00 <leg7> https://0x0.st/X-O7.txt
21:40:00 <zid> where is usr/sys/stand
21:40:00 <heat_> your gdtr limit is wrong
21:40:00 <zid> I have kernel/ and libc/ and kernel/ contains like.. Kernel.c and multiboot.s
21:40:00 <heat_> isn't it?
21:40:00 <zid> this might be the one from grub?
21:40:00 <heat_> i'm talking about their -d int dump
21:40:00 <leg7> are you on the gdt branch?
21:40:00 <zid> ah okay will do
21:40:00 <leg7> I didn't push to main
21:41:00 <leg7> kernel/memory
21:41:00 <leg7> is the limit the size?
21:41:00 <heat_> size - 1
21:41:00 <zid> oh I have to merge my Makefile changes nooo :P
21:42:00 <leg7> Did I not do that?
21:42:00 <leg7> oh
21:42:00 <heat_> qemu is showing a power of 2
21:42:00 <heat_> well, even number
21:42:00 <heat_> you should see my gdt code i promise i dont enforce the GPL on GDT code
21:42:00 <zid> nice, makefile is way better in this branch
21:42:00 <leg7> Well ok the size/limit was wrong but it's still crashing
21:43:00 <leg7> don't worry my code is gpl too
21:43:00 <heat_> ok then see my code
21:43:00 <leg7> Did you see what my gdt looks like?
21:44:00 <leg7> from the earlier screenshot?
21:44:00 <heat_> yes but im not decoding it
21:44:00 <leg7> ok
21:44:00 <heat_> even more so because you gave me a screenshot
21:44:00 <heat_> like seriously what
21:44:00 <leg7> I'm sorry
21:44:00 <heat_> your GDB GUI doesn't support copy pasting
21:46:00 <heat_> everything around the 5f bits looks wrong
21:46:00 <heat_> 0x00CF9A000000FFFF <-- this is a valid 32-bit CS
21:47:00 <zid> I'm re-fighting my tools, it's weirdly going worse the second time around
21:47:00 <zid> some 64bit .o is sneaking in somewhere and idk where beacuse it's doing it through tmp
21:47:00 <heat_> the 'a' nibble being the cs gdt segment type, and the rest being... a bunch of flags
21:47:00 <leg7> https://0x0.st/X-Ve.png
21:47:00 <leg7> here's how it looks like
21:48:00 <leg7> maybe I got the masks wrong
21:49:00 <leg7> either that or the nasm function is incorrect
21:51:00 <zid> I am being dumb or something
21:51:00 <kof673> https://www.gnu.org/software/ddd/ DDD--A Free Graphical Front-End for UNIX Debuggers [...] (Informatik-Bericht No. 95-07, 7 August 1995) <-- that has been around forever, but i never bothered, plus...motif.... :/
21:51:00 <bslsk05> ​www.gnu.org: DDD - Data Display Debugger - GNU Project - Free Software Foundation (FSF)
21:52:00 <kof673> *the arrow is pointing at the 1995 date for the article
21:52:00 <zid> gcc -T linker.ld ./build/kernel/Kernel.o ./build/kernel/memory/Gdt.o ./build/kernel/graphics/VgaTextMode.o ./build/libc/string/string.o ./build/kernel/memory/Gdt.nasm.o ./kernel/multiboot.s -o isodir/boot/os.bin -ffreestanding -nostdlib -ggdb -no-pie -Wl,-melf_i386
21:52:00 <zid> /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld: i386:x86-64 architecture of input file `/tmp/ccc0Zo9k.o' is incompatible with i386 output
21:52:00 <zid> why tmp, like I passed -pipe even though I didn't, and where is the 64bit .o sneaking in
21:53:00 <zid> I literally did find . -name "*.o" | xargs file and they're all 32
21:53:00 <zid> the also your run to build .o from .s seems like it isn't being used
21:53:00 <zid> rule*
21:53:00 <heat_> found it
21:53:00 <heat_> ./kernel/multiboot.s
21:53:00 <heat_> pass -m32
21:53:00 <zid> oh did I not have -m32 in that one, just the cflags one.. fuck
21:54:00 <leg7> the gas compiler needs -m32?
21:54:00 <zid> there we go
21:55:00 <zid> check_exception old: 0xffffffff new 0xd
21:55:00 <zid> 0: v=0d e=0000 i=0 cpl=0 IP=0008:000000000020042f
21:55:00 <zid> huzzah
21:56:00 <leg7> so that fixed it?
21:56:00 <leg7> https://0x0.st/X-VV.txt
21:57:00 <leg7> It's still closing for me
21:57:00 <zid> sigh how do I make qemu not use port 1234
21:58:00 <leg7> for gdb?
21:58:00 <zid> my machine's been hacked and something's already listening on 1234
21:58:00 <leg7> in my makefile I change it
21:58:00 <leg7> also I have a .gdbinit that will setup gdb up
21:58:00 <leg7> setup gdb*
21:59:00 <leg7> if you open gdb in the src/
22:00:00 <zid> I just moved my ssh tunnel, easier
22:00:00 <zid> than recompiling qemu
22:00:00 <leg7> It's just an option
22:00:00 <zid> what
22:00:00 <zid> -s makes qemu listen on port 1234
22:00:00 <zid> I need it to *not do that*
22:00:00 <leg7> qemu-system-i386 -cdrom $(OS_ISO) -S -gdb tcp::26000 -no-shutdown -no-reboot -d int
22:00:00 <zid> oh really?
22:00:00 <zid> fuck
22:01:00 <leg7> if you do `make run` in one terminal it will execute that
22:01:00 <zid> I do not have
22:01:00 <zid> qemu-system-i386
22:01:00 <zid> or an iso
22:01:00 <leg7> and open gdb in another while in src and it will auto connect
22:01:00 <leg7> I'm sorry I thought you were debuggin my os
22:02:00 <zid> I am.
22:02:00 <leg7> oh
22:02:00 <zid> I do not have your weirdo tools.
22:02:00 <zid> I have 64bit qemu, because.. why wouldn't I
22:02:00 <heat_> how do you not have qemu-system-i386?
22:02:00 <heat_> those two are usually packaged together
22:02:00 <heat_> like, x86_64 is literally just a superset
22:02:00 <zid> packaged? lol
22:03:00 <zid> fuck, I don't have i386 gdb
22:03:00 <leg7> gentoo life
22:03:00 <zid> workedaround
22:03:00 <zid> why are you loading 8 into ss at all
22:04:00 <zid> this makes no sense
22:04:00 <leg7> I followed a tutorial
22:04:00 <zid> oh that'd do it
22:04:00 <zid> is cs loaded with 16 then?
22:05:00 <zid> nope, also 0x8
22:05:00 <zid> you're putting your code selector into cs, then putting your code selector into all other regsiters too
22:05:00 <zid> try putting the.. data selector into those ones
22:05:00 <leg7> shouldn't ebp+12 be the data selector?
22:06:00 <zid> idk, you're loading 8 into it
22:06:00 <leg7> I meeanm
22:06:00 <leg7> ebp+14
22:06:00 <heat_> why is this configurable at all?
22:06:00 <heat_> just hardcode it
22:06:00 <leg7> the tutorial I followed leaded ebp+16
22:06:00 <zid> I also cannot copy paste from gdb, heat
22:06:00 <leg7> but I think that's just wrong
22:06:00 <zid> cus layout asm is really really fucky
22:06:00 <heat_> using gdb tui is pebkac
22:06:00 <geist> they probably put the gdt pointer on the stack?
22:06:00 <leg7> because the params are 32 bit 16 bit 16 bit
22:06:00 <geist> and then did a lgdt or it
22:07:00 <zid> I should have used gef but idk if it supports 32bit
22:07:00 <zid> ebp+12 is '8'
22:07:00 <leg7> yeha
22:07:00 <zid> which is your code selector, seeing as that's what's in cs
22:07:00 <geist> oh i see loading the cs
22:07:00 <leg7> and since it's 16 bit shouldn't ebp+14 be 16?
22:07:00 <zid> info registers cs: cs 0x8 8
22:07:00 <geist> yah 100% of systems just use 0x8 0x10 there, (2nd and 3rd entry) and to load cs you just do a far jump to it, or you use a retf
22:07:00 <zid> that's 0.. can you push shorts in your abi?
22:08:00 <zid> +16 is 0x10
22:08:00 <leg7> What?
22:08:00 <leg7> why?
22:08:00 <zid> ebp+12 is 8, ebp+16 is 16
22:08:00 <leg7> does c code not push shorts?
22:08:00 <zid> it's not C that's responsible for this, it's the ABI
22:09:00 <zid> hell, in long mode you physically *can't* push chars, for example
22:09:00 <zid> no worky
22:09:00 <leg7> I mean gcc usses sys V abi?
22:09:00 <leg7> right
22:09:00 <leg7> and the sys V abi pushes shorts
22:09:00 <heat_> yes this is a sysv abi detail
22:09:00 <leg7> no?
22:09:00 <heat_> no
22:09:00 <leg7> damn
22:09:00 <leg7> ok
22:09:00 <leg7> but it still crashes with ebp+16
22:09:00 <leg7> I tried that earlier
22:09:00 <zid> where do I change that
22:09:00 <leg7> and tried it again
22:10:00 <geist> it's behavior of the stack, the cpu itself will align the stack when you push it
22:10:00 <geist> based on the mode its in
22:10:00 <heat_> your gdt is fucked, i'm telling you
22:10:00 <heat_> i told you to check my gdt, you didn't
22:10:00 <leg7> ok yes the stack is algined on 4
22:10:00 <leg7> I remember
22:10:00 <zid> if loading 0x10 also fails, that selector is broken
22:10:00 <zid> where do I edit it to try that
22:10:00 <heat_> the gdt looks nothing like a normal 32-bit gdt
22:10:00 <leg7> What do you want to edit?
22:10:00 <zid> I want to load 0x10 not 0x8, you seemed to have 'fixed' a stack misalignment bug somewhere
22:10:00 <zid> where
22:10:00 <leg7> you can edit Gdt.nasm
22:10:00 <zid> wher eis that
22:11:00 <leg7> kernel/memory/
22:11:00 <zid> ..naturally
22:11:00 <leg7> src/kernel/memory/Gdt.nasm
22:11:00 <leg7> change ebp+14 to ebp+16
22:11:00 <leg7> line 21
22:11:00 <leg7> char 22
22:12:00 <zid> loading ds with 0x10 faults
22:13:00 <zid> That selector is.. 0x5f8b000000ffff
22:13:00 <geist> i concur with heat_ . your gdt is probably broken, also did you make sure your lgdt is long enough?
22:13:00 <geist> the length part
22:13:00 <zid> it's 0x18 which is long enough for 3 entries right?
22:14:00 <geist> yah
22:14:00 <leg7> I'll push my changes
22:14:00 <heat_> yes but the entries are completely borked
22:14:00 <geist> (though i think it's -1)
22:14:00 <zid> it's off by 1 though
22:14:00 <zid> should be 0x17
22:14:00 <geist> but it being one byte too long should be fine
22:14:00 <zid> yea
22:14:00 <zid> I want my gdt.html back :(
22:14:00 <geist> so yeah lets get that gdt fix
22:14:00 <geist> leg7: did you derive the gdt from scratch or get it from somewhere else?
22:14:00 <leg7> I pushed the fixes
22:14:00 <leg7> so far
22:15:00 <leg7> I followed a tutorial loosely but I wrote some stuff myself
22:15:00 <geist> what about the contents of the gdt itself?
22:15:00 <geist> side note, what tutorial was it?
22:15:00 <leg7> I was trying to separate the access byte with bit fields but my solution wasn't that great so I copied the guys solution using masks and a macros
22:16:00 <leg7> osdev.org and a youtube guy
22:16:00 <geist> kk
22:16:00 <leg7> let me lookup the vid
22:16:00 <leg7> https://piped.kavin.rocks/watch?v=5LbXClJhxcs
22:16:00 <bslsk05> ​'Building an OS - 8 - Interrupts, IDT, GDT' by nanobyte (00:36:53)
22:16:00 <geist> i only ask because a sizable chunk of vids are completely wrong
22:17:00 <geist> lots of times the tutorials are done by folks that have only just figured things out so they pass on bad ideas
22:17:00 <geist> or bad advice. not all of them, but some of them
22:17:00 <zid> I don't have any valid 32bit selectors to hand, only 64 :(
22:17:00 <leg7> Ok I will keep that in mind
22:17:00 <zid> maybe I could ask grub
22:17:00 <Ermine> kavin rocks !!!
22:17:00 <geist> heats are good, for a second opinion: https://github.com/littlekernel/lk/blob/master/arch/x86/gdt.S#L42
22:17:00 <bslsk05> ​github.com: lk/arch/x86/gdt.S at master · littlekernel/lk · GitHub
22:18:00 <Ermine> (actually no)
22:18:00 <geist> that has both 32 and 64bit selectors
22:18:00 <zid> I'd have to convert to hex :P
22:18:00 <leg7> I always try to figure things out myself first but this gdt nonsense was too much I didn't understand the diagrams on osdev.org
22:18:00 <zid> 0xCF 0xF2
22:18:00 <zid> that'll do
22:18:00 <Ermine> heat_: geist called you good
22:19:00 <geist> well, like i trust whatver heat links from his own system to be solid and functional
22:19:00 <zid> The intel manual is better
22:19:00 <zid> than osdev wiki for *anything*
22:19:00 <zid> if it's in the manual, read it there
22:19:00 <heat_> dang, this is going to my grave
22:20:00 <heat_> <geist> well, like i trust whatver heat links
22:20:00 <heat_> just this part is good
22:20:00 <heat_> quicke veryone visit http://kernal.org/
22:20:00 <geist> are you making a soundbyte out of it?
22:20:00 <bslsk05> ​kernal.org: ArmageddonSoon.com
22:20:00 <geist> 'from his own system'!
22:21:00 <Ermine> I want to seize this domain
22:21:00 <geist> i only really link the LK one because i did go through a fair amout of effort to comment every bit in it, and i think it's fairly clear
22:21:00 <geist> or at least clear enough to cross reference with the intel or amd manual
22:22:00 <leg7> I have the intel manual in the repo
22:22:00 <leg7> it's in /docs
22:22:00 <leg7> I've used it a couple times
22:22:00 <leg7> But I couldn't find gdt stuff
22:22:00 <Ermine> you don't need to store it in repo
22:22:00 <geist> it's definitely in there
22:22:00 <geist> the gdt stuff
22:23:00 <geist> side note: sometimes for early bringup i find the AMD manual to be a bit clearer
22:23:00 <leg7> I know I don't neeed to put it in the repo but it's more convinient
22:23:00 <geist> especially GDT/IDT layout
22:23:00 <Ermine> and is your repo is public it may be illegal actually
22:23:00 <leg7> there is no copyright notice in it
22:23:00 <zid> it appears to work if I fix the gdt
22:23:00 <zid> because I managed to crash it somewhere that isn't that
22:24:00 <geist> also i find that sometimes going to a much older manual, like the 386 manual itself, to be clearer for some of these basic things
22:24:00 <zid> oh wait, no, I crashed it by running SSE2, whoops :D
22:24:00 <geist> since it filters out all the later cruft
22:24:00 <leg7> my experience so far is that there is so much legacy crap
22:24:00 <leg7> it's annoying af
22:25:00 <zid> It now crashes at lret on 0x200442 which is.. GdtLoadi686's return point?
22:25:00 <zid> hmm
22:25:00 <zid> the cs is unhappy I guess
22:25:00 <leg7> What did you change?
22:25:00 <zid> *oh* user and code are upside down in heat's thing
22:27:00 <heat_> i have code first yeah
22:27:00 <geist> entry 1 and 2 for code and data? sure
22:27:00 <zid> char fake[16] = {
22:27:00 <zid> 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xF2, 0xCF, 0x00,
22:27:00 <zid> 0xff, 0xff, 0x00, 0x00, 0x00, 0xFA, 0xCF, 0x00
22:27:00 <zid> };
22:27:00 <zid> :D
22:28:00 <geist> that's data code right? looks like the DPL is set to 3
22:28:00 <zid> oh right those are user
22:28:00 <zid> should be 9s not Cs
22:28:00 <geist> yeah for 64bit there are layout requirements
22:29:00 <zid> yea I know, I've done it
22:29:00 <geist> iirc data has to go in front of code for reasons
22:29:00 <zid> You thought mine wasn't going to work
22:29:00 <zid> but it does
22:29:00 <geist> uh no?
22:29:00 <zid> yea, I remember it
22:29:00 <geist> ah it has seared into your mind?
22:29:00 <zid> but it turns out other layouts work if you don't care about the emulation segs
22:29:00 <geist> dissaproval from geist
22:29:00 <zid> no?
22:29:00 <zid> I just.. remember the convo
22:29:00 <geist> heh
22:29:00 <geist> back when we used to argue all the time
22:30:00 * kof673 inserts joke about doug16k bench marked and uses an optimized gdt and idt layouts
22:30:00 <heat_> no but his tables were all nicely aligned as the intel sdm recommends
22:30:00 <kof673> lol
22:30:00 <geist> heh yeah i remember that. aligning it so that the corresponding code/data entries are in the same cache line
22:39:00 <leg7> https://0x0.st/X-V5.png
22:39:00 <leg7> Is my `limitLow` correct?
22:40:00 <leg7> shouldn't it be one more
22:40:00 <zid> oops forgot m y null selector now
22:40:00 <leg7> to be 0xFF'FF'FF
22:40:00 <leg7> it's 65535
22:41:00 <leg7> but shouldn't it be 65536?
22:41:00 <heat_> no
22:41:00 <heat_> 65536 is 1 << 16 aka 16-bits
22:41:00 <heat_> 17-bits*
22:42:00 <leg7> 2^16 is the biggest value a 16 bit binary unsigned integer can hold right?
22:42:00 <zid> no
22:42:00 <Ermine> 2^16 - 1 actually
22:42:00 <zid> 2^16 is 1 then 16 zeroes
22:42:00 <geist> you want all 15 bits set, this 1<<16 - 1
22:43:00 <zid> like how 1e100 is 1 then 100 zeroes
22:43:00 <Ermine> 2^16 is 1 and 16 zeros
22:43:00 <leg7> ok my bad
22:43:00 <leg7> then limit low is correct
22:43:00 <heat_> the gang figures out modular arithmetic
22:43:00 <leg7> base is correct too
22:44:00 <heat_> quick, find the inverse of 10 mod 2^16
22:44:00 <Ermine> it doesn't exist
22:44:00 <leg7> limitHigh is correct too because 15 is 2^4 - 1
22:44:00 <zid> I think I got it running btw
22:45:00 <Ermine> 10 and 2^16 are not coprime
22:45:00 <zid> I can confirm that the ebp+16 fix, and then fixing the gdt entries, appears to cause it to run, at least, if he comes back
22:45:00 <heat_> Ermine, NERD
22:46:00 <heat_> yeah i was taking a piss and realized that you can't multiply 10 by any number and get an odd number
22:46:00 <Ermine> Yes, as in 'math faculty student'
22:48:00 <leg7> hey
22:48:00 <leg7> sorry I closed irc by accident
22:48:00 <Ermine> it's been a while
22:48:00 <leg7> and didn't know how to log back in
22:49:00 <leg7> Did you say you got it working?
22:49:00 <zid> it appears to work? it stops crashing at least
22:49:00 <zid> if I fix the gdt entries (with that ebp+16 fix)
22:49:00 <leg7> So you just pulled my fixes and it works?
22:49:00 <zid> no?
22:49:00 <leg7> It still crashes on my end
22:49:00 <leg7> oh
22:49:00 <zid> I changed ebp+14 to ebp+16, then fixed the gdt entries
22:49:00 <leg7> What did you change in the entries?
22:50:00 <zid> idk because I didn't use yours
22:50:00 <zid> I just hardcoded some filled out ones
22:50:00 <leg7> ugh
22:50:00 <leg7> ok
22:50:00 <zid> (qemu) x /3gx 0x202018
22:50:00 <zid> 0000000000202018: 0x0000000000000000 0x00cf9a000000ffff
22:50:00 <zid> 0000000000202028: 0x00cf93000000ffff
22:50:00 <zid> it appears to be happy with these, I stole them from grub
22:51:00 <geist> yep, i recognize those as the defacto 0x80 and 0x10 for DPL 0 32bit
22:51:00 <zid> okay so the machine with gdt.html was on AWS
22:51:00 <heat_> mine didn't work?
22:51:00 <zid> and the backup script wasn't working and the AWS was.. no longer being paid for, so the machine disappeared
22:51:00 <geist> cf9a and cf92 usually, though. but that's to do with the A bit
22:52:00 <zid> heat_: no but maybe I had them upside down
22:52:00 <geist> cf93 has the A bit set that i dont have in my GDT
22:52:00 <heat_> yeah A gets auto-set
22:52:00 <zid> yea they had the A bit set after them having been used to boot grub
22:52:00 <zid> so when I stole them from grub, I got it
22:52:00 <geist> ah makes sense yeah
22:52:00 <heat_> although it's important to have A set beforehand if the GDT is in rom
22:52:00 <heat_> otherwise historically a bunch of intel cpus have just hanged
22:52:00 <geist> yeah was looking it up before i opened my mouth and thought A was 'accessed' vs some alignment thing or something
22:53:00 <zid> 200441: eb fd jmp 200440 <_start+0xb>
22:53:00 <geist> but the A bit doesn't get set for code segments?
22:53:00 <zid> that's where I get to, apparently, seems legit
22:53:00 <zid> while(1) asm("hlt");
22:53:00 <leg7> am I supposed to read those hex codes as little endian?
22:53:00 <geist> yes
22:53:00 <leg7> ok
22:53:00 <Ermine> are there embedded x86 devices which could have gdt in rom?
22:54:00 <zid> The 1gx output is read from memory as though it were little endian yea
22:54:00 <geist> those numbers match with link from my stuff: https://github.com/littlekernel/lk/blob/master/arch/x86/gdt.S#L43
22:54:00 <heat_> Ermine, every x86 firmware ever
22:54:00 <bslsk05> ​github.com: lk/arch/x86/gdt.S at master · littlekernel/lk · GitHub
22:54:00 <zid> so my flat arrays are 0xFF 0xFF 0xFF ..
22:54:00 <geist> with the numbers broken out
22:54:00 <zid> 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xcF, 0x00,
22:54:00 <Ermine> heat_: ok, but soomething except motherboard firmwares?
22:54:00 <zid> 0x00cf9a000000ffff
22:55:00 <geist> notably 0b10011010 (0x9a) and 0b10010010 (0x92)
22:55:00 <geist> bit 3 being the code vs data segment
22:55:00 <leg7> well I have 9b instead of 9a
22:55:00 <zid> should I just re-make my gdt tool
22:56:00 <heat_> yasss queen
22:56:00 <zid> okay heat volunteered
22:56:00 <leg7> and 5f instead of cf
22:56:00 <leg7> what the fuck
22:56:00 <zid> 5f is definitely wrong :P
22:56:00 <leg7> what is the command to print out the hex values in gdb again
22:57:00 <leg7> so I am sure not to make mistakes converting
22:57:00 <zid> x
22:57:00 <zid> then /, then how many, then what size, then in what base, so /32bx or /3gx
22:57:00 <zid> for bytes of hex, giant-words of hex
22:57:00 <zid> x for examine I think
22:58:00 <leg7> can't copy paste still fml
22:58:00 <Ermine> > hsd
22:58:00 <Ermine> heat_, are you developing another os?
22:58:00 <leg7> 0x005f9b000000ffff 0x005f8b000000ffff
22:58:00 <zid> 5F is 01011111
22:58:00 <heat_> Ermine, i have 3 operating systems
22:58:00 <zid> That means.. DPL 2, type 1111
22:59:00 <leg7> dpl is ring?
22:59:00 <zid> yea
22:59:00 <zid> descriptor priv level
22:59:00 <zid> 325462-sdm-vol-1-2abcd-3abcd.pdf page 3159
22:59:00 <heat_> Ermine, hsd is basically my attempt at a early BSD clone with cryptic code
22:59:00 <heat_> it's also 32-bit only
23:00:00 <Ermine> woah
23:01:00 <leg7> I don't understand how my entries can be 9b
23:01:00 <leg7> I'm literally oring with GdtEntryAccessRing0
23:01:00 <zid> hrmph I wanted to go back to reading my book but I've gone blind
23:01:00 <leg7> which is 0
23:03:00 <Ermine> heat_: so you liked bsds in the past?
23:04:00 <zid> https://github.com/zid/boros/blob/gameboy/gdt.c#L74 Yea the lstar crap makes the user ones upside down, how rude
23:04:00 <bslsk05> ​github.com: boros/gdt.c at gameboy · zid/boros · GitHub
23:05:00 <heat_> Ermine,
23:05:00 <heat_> oops im stupid
23:05:00 <heat_> Ermine, no hsd is pretty recent
23:07:00 <leg7> So the 9b part is just me setting the "accessed" bit in the access byte
23:07:00 <leg7> if I don't set it it's 9a but still crashes
23:07:00 <geist> leg7: what types are all those constants?
23:07:00 <leg7> u8
23:07:00 <geist> i get the idea what you're trying to do there with the very structured way, but sometimes that gets in your way
23:08:00 <leg7> yeah I realized
23:08:00 <leg7> I would like to know why it doesn't work though
23:08:00 <geist> i dont have your code in front of me but if you're trying to merge them into a larger word it could get clipped off?
23:08:00 <leg7> last problem should be the flags
23:08:00 <geist> i'd go back and super double triple check all your constants
23:08:00 <leg7> Yeah I'm doing that
23:09:00 <zid> ULL them
23:09:00 <leg7> so far the access byte and flags seem gucci
23:09:00 <geist> paste a link please
23:09:00 <leg7> I mean not flags
23:09:00 <leg7> I'm checking flags
23:09:00 <geist> to the constants that is
23:09:00 <zid> and tbh, you'd b e better off just writing these in a normal desktop program
23:09:00 <zid> then printfing them at the end
23:09:00 <zid> *then* add the code to your OS
23:09:00 <geist> and the comment how you got them, so future you knows how to deal with it
23:10:00 <leg7> https://raw.githubusercontent.com/leg7/LigmaOS/gdt/src/kernel/memory/Gdt.h
23:10:00 <zid> It's very blazé to do it in-kernel with limited debug functionality, when it's so easily tested otherwise
23:10:00 <geist> that's usually my take, if it's a single one time thing, like the GDT, there's not a lot of purpose building a whole infrastructure to synthesize the constants
23:10:00 <leg7> This is my first OS so I supposed I would need it later
23:11:00 <geist> hmm, those bitfields may be doing it
23:11:00 <geist> are you sure the two 4 bit fields are sorted that way?
23:11:00 <zid> Those all need extending to ULL if you shift them btw
23:11:00 <geist> re: flags and limit 19:16
23:11:00 <leg7> wdym sorted?
23:11:00 <geist> well, bitfields are ABI defined how they pack
23:12:00 <zid> A then B, or B then A
23:12:00 <geist> right
23:12:00 <geist> tis why *usually* it's not a good idea to use them for hardware, though if it's for exactly the same architecture, it's probalby more okay, provided you figure out which way it's doing it
23:12:00 <zid> and if you do `some_u8 << 32` that gives 0
23:12:00 <zid> you need some_u8 to be an unsigned long for big shifts, just fyi
23:12:00 <geist> so you might need to do flags before limit in your GDT structure
23:13:00 <geist> zid: they're not using anything larger than 8 in this case, so shouldn't be an issue
23:13:00 <zid> I can't really read it right now, so I'm just throwing shit out
23:13:00 <geist> i'm specifically talking about
23:13:00 <geist> u8 limitHigh : 4;
23:13:00 <geist> u8 flags : 4; // defined like access
23:13:00 <zid> I'm having a migraine so I can't see most of my screen
23:14:00 <geist> in the packed GdtEntry struct
23:14:00 <geist> zid: ugh, i'm having more of those lately. i tried to code the other day while having an vision migrane
23:14:00 <geist> no bueno, can watch lightweight youtube vids
23:14:00 <zid> I got a bunch of them when I was a teen, then they went away for a decade or two, now they're back
23:14:00 <geist> scintillating scotoma
23:14:00 <zid> yep
23:15:00 <geist> yah i get one maybe once a month or so. no obvious cause
23:15:00 <zid> I got precisely 0 in my 20s
23:15:00 <zid> but have had them in my teens and 30s, odd
23:15:00 <geist> oh i didn't get my first one until i was like 40
23:15:00 <leg7> Well when I read the values with gdb it matches what I did with the or operation so I don't think bitfields are a problem
23:15:00 <geist> when the lightning bolt crosses the center of my vision i basically cant read anything, but otherwise it's mostly annoying
23:15:00 <geist> but usually moves off my vision in about 30 minutes
23:16:00 <geist> leg7: so what value did you read from gdt?
23:16:00 <leg7> Well I posted a screenshot a couple times I'll post it again
23:16:00 <geist> yyah i'm really not going to try to go back and figure out what the last, correct, screenshot is
23:17:00 <zid> I'd probably just do it in reverse in userspace
23:17:00 <zid> data = 0xcf9a...FFFF; then dump all the fields back out and make sure they have the bit pattern I expect
23:17:00 <geist> but yeah it checks out. from what i can read fro the gdt.h file
23:17:00 <geist> aside from the bitfield
23:17:00 <Ermine> Libbsd release notes: > fix build on gnu/hurd, > fix build on musl
23:17:00 <leg7> https://0x0.st/X-WK.png
23:18:00 <zid> I actually had a bug in my gdt.c where I was offset by 1 bit, didn't find at first because the bit I fucked up was 0 and supposed to be 0
23:18:00 <geist> huh nice that it givces you decimal and octal
23:18:00 <zid> I needed to change it to a 1 later on and suddenly nothing works right for no reaosn :D
23:18:00 <geist> really helpful :)
23:19:00 <leg7> I'm a brainlet so octal doesn't help
23:19:00 <zid> geist is old enough to own a VAX
23:19:00 <zid> so he cares about octal
23:19:00 <zid> everybody under 50 doesn't
23:19:00 <geist> anyway it's '5f' instead of 'cf'
23:19:00 <geist> now the question is why....
23:19:00 <geist> that's in the flags field, lie it's shifted over 1 bit
23:20:00 <leg7> yep
23:20:00 <zid> There are some big shifts in there, which I was worried about, but they all go right so fuck it, unless base is a u16 etc
23:20:00 <geist> oh also bit 3 of the flags field is not resered by the cpu
23:20:00 <geist> it is 'G'
23:20:00 <geist> needs to be set to 1
23:20:00 <leg7> https://osdev.org/Global_Descriptor_Table
23:20:00 <bslsk05> ​osdev.org: Global Descriptor Table - OSDev Wiki
23:21:00 <leg7> yeah it's bit 0 actually
23:21:00 <leg7> fml
23:21:00 <zid> > 325462-sdm-vol-1-2abcd-3abcd.pdf page 3159
23:21:00 <geist> yep, there ya go
23:21:00 <geist> G DB L 0
23:21:00 <zid> https://cdn.discordapp.com/attachments/417023075348119556/1228847621183901867/image.png?ex=662d8887&is=661b1387&hm=eb19a63935f1a0d0f6c3744a74318ea6fe937dd905378145c0fde07c59a6c2f2&
23:21:00 <geist> and you want that to be 1 1 0 0
23:22:00 <geist> 4K granularity, 32bit segment, not long mode, reserved (0)
23:22:00 <zid> (The way it's laid out aligns with the giant hex layout, which is nice)
23:23:00 <geist> yep
23:23:00 <geist> also it kinda depends on which version of the manual you're talking about, bit 1 in the flags has new meaning in long mode
23:23:00 <geist> and yeah bit 0 in flags is AVL, not reserved
23:24:00 <zid> I can't screenshot my hard copy of the 32bit manual sadly :P
23:24:00 <zid> If I were doing 32bit I'd probably use those over the pdf 64bit manual
23:24:00 <zid> just for less clutter
23:24:00 <geist> what i like about the AMD manual is that it describes all of the tables in one place, GDT, LDT, IDT, etc
23:25:00 <geist> and points out that the way the type field connects up makes sense, and actually there's only one table format
23:25:00 <geist> which is not as obvious from the intel manual which introduces GDT and IDT in separate places
23:25:00 <zid> yea there *is* a good type description, but it isn't here
23:25:00 <zid> which is annoying
23:25:00 <geist> so it's pretty neat. IDT can't be misinterpreted as GDT and vice versa, IIRC
23:25:00 <leg7> Also my 32bit and 64bit enum was messed up too
23:26:00 <leg7> GdtEntryFlagsSegmentsWidth
23:26:00 <leg7> that is
23:26:00 <geist> yeah, it's only one bit
23:26:00 <geist> i shoulda caught that before
23:27:00 <zid> osdev wiki actually wins there, it has a nice 1: 16-bit tss, 2 = ldt, 3 = 16-bit tss busy, 9 = 32-bit tss, .. table
23:27:00 <zid> it's just styled in an ugly way
23:27:00 <zid> It's mainly just a copy of the intel manual, but with less pretty graphics
23:28:00 <geist> yeah it's not super clear, but basically if the S bit is not set then it's something else, like a task or an interrupt descriptor
23:29:00 <leg7> I couldn't understand the osdev graphics to save my life
23:29:00 <leg7> I looked at them for 2 days trying to understand
23:29:00 <geist> but it's all set up such that if you interpret bit 40 through 44 as a type field there's no way they overlap
23:29:00 <geist> well, to be honest the proper sollution to all of this is to real the intel and/or amd manual
23:29:00 <geist> it's a big effort but then you're not just cobbling stuff together after the fact
23:29:00 <leg7> I still can't find gdt info in the intel manual
23:30:00 <geist> then you didn't read it
23:30:00 <geist> you skimmed it, looking for what you wanted
23:30:00 <zid> 5.2
23:30:00 <geist> i mean, like literally read it
23:30:00 <zid> I even gave the page number
23:30:00 <geist> sit down and read the manual, maybe skip over the parts where it goes over every instruction, but absorb it
23:31:00 <geist> start with an older version, like the pentium era maybe
23:31:00 <leg7> of course I skimmed it it's 5000 pages
23:31:00 <leg7> wtf
23:31:00 <geist> i've read it
23:31:00 <zid> you don't need to read the bits you aren't up to yet
23:31:00 <geist> many times, both the intel and AMD
23:31:00 <zid> but it's handy if you read the bits you are doing..
23:31:00 <zid> like, I've never read the bit about thermal alarm watchdog bananas, but I've defo read the gdt part
23:31:00 <leg7> I've read like 100 pages of it
23:31:00 <geist> at least start with the basics of the arcticture, how the registers are laid out
23:31:00 <zid> In other words, I can see again hoorah
23:31:00 <leg7> but if I can't find what I'm looking for in it I'm not going to read all 5000 pages
23:31:00 <geist> then go over to the part where it talks about system mode. generally the flow of interrupts, exceptions, paging
23:32:00 <geist> then that introduces you to the concepts so you have something to hang your hat on
23:32:00 <geist> then you can start skimming
23:32:00 <leg7> I read those
23:32:00 <leg7> excetpt exceptions
23:32:00 <leg7> and interrupts
23:32:00 <geist> then i'm blown away youdidn't find the GDT stuff
23:32:00 <geist> it's a very core component of the arcthiecture
23:32:00 <heat_> you read those but without thos
23:32:00 <heat_> just the 'e'
23:32:00 <geist> you probably skipped the section on segmentation thinking you didn't need it
23:32:00 <geist> but alas
23:33:00 <heat_> if you read the paging bits then describe how the paging works
23:33:00 <leg7> I read the segmentation section
23:33:00 <leg7> it's just not that good
23:33:00 * geist shrugs
23:33:00 <geist> anyway, you're close
23:33:00 <heat_> yeah i agree the intel SDM is a bad book
23:33:00 <heat_> what was the author thinking
23:33:00 <heat_> no character development, nothing
23:33:00 <heat_> just "segmentation"
23:33:00 <geist> no thats the ARM manual
23:33:00 <geist> it just tosses you directly in the deep end
23:34:00 <leg7> my flag byte is still fucked up
23:34:00 <geist> well, zid fixed it over on sugmaos
23:34:00 <leg7> nvm
23:34:00 <leg7> it's not fed up
23:35:00 <leg7> the data one is
23:35:00 <leg7> bruh
23:35:00 <heat_> geist, what's sugma
23:35:00 <geist> it's bofa ligma and sugma
23:35:00 <leg7> acces byte is messed up for the data segment
23:36:00 <geist> heat_: https://youtu.be/KZfq9amWaJg
23:36:00 <bslsk05> ​'Ligma, ligma what you ask? Bofa, bofa what you ask? Sugma, sugma what you ask?' by rkgames (00:02:14)
23:36:00 <leg7> I have 8a
23:36:00 <leg7> should be 93
23:36:00 <leg7> Bofa?
23:36:00 <geist> dude your os is named ligmaos, *clearly* you're in on it
23:36:00 <geist> if not you should change it
23:37:00 <leg7> I've never heard bofa
23:37:00 <leg7> I swear
23:37:00 <heat_> how old are you
23:37:00 <kof673> bastard operator from...argentina
23:37:00 <leg7> 22
23:37:00 * kazinsal . o ( LigamentOS )
23:37:00 <heat_> in 22 years of age you must've heard all the fucking variants
23:37:00 <heat_> or you've been without internet for 22.9 of those 22 years
23:37:00 <leg7> Well I'm not a native english speaker
23:37:00 <leg7> so maybe that's why
23:38:00 <leg7> I know ligma, sugma, dragon, candice
23:38:00 <Ermine> I know only ligma
23:38:00 <geist> 'bofa' == both of
23:38:00 <heat_> Ermine, bofa deez patchez
23:38:00 <leg7> bofadiznuts
23:38:00 <geist> right, so yeah.
23:38:00 <kazinsal> iirc the origin of the deez nuts joke is early 90s west coast hip hop
23:39:00 <kazinsal> it's been around for a while
23:39:00 <geist> i may be old, but i grok these
23:39:00 <CompanionCube> oh that's what it means, i saw it alot but never actuallly got the meaning, now i feel stupid
23:39:00 <leg7> thank you I will use bofa from now on
23:39:00 <zid> leg needs to take lessons from biboo
23:39:00 <leg7> biboo?
23:40:00 <geist> but hey, you got it easy, you could be writing an os for ITAAAANIUM
23:40:00 <zid> streamer, her chat constantly try and ger her with ligma jokes but she always expertly avoids them
23:40:00 <heat_> leg7, have you heard of updog?
23:40:00 <Ermine> heat_: now I know how I'll ping you on new patches
23:40:00 <kazinsal> geist: that's easy, the magic compiler will just do the heavy lifting for you!
23:40:00 <Ermine> meanwhile, zathura fails to display intel sdm
23:41:00 <geist> anyway i hadn't thought about the ligma doctor in a year or two, memories
23:42:00 <leg7> yeah wassup dog
23:43:00 <zid> https://www.youtube.com/watch?v=CAqKu6oEZxk
23:43:00 <bslsk05> ​'𝗜𝘁 𝘁𝗼𝗼𝗸 𝗕𝗶𝗯𝗼𝗼'𝘀 𝗖𝗵𝗮𝘁 𝗮𝗹𝗺𝗼𝘀𝘁 𝟯 𝗺𝗼𝗻𝘁𝗵𝘀 𝘁𝗼 𝗮𝗰𝗰𝗼𝗺𝗽𝗹𝗶𝘀𝗵 𝘁𝗵𝗶𝘀... |Hololive|' by Gomi Simpington Ch. (00:07:02)
23:44:00 <geist> ahahah
23:45:00 <geist> omg i'm losing it over here
23:48:00 <Ermine> But does anybody write OSen for m68k?
23:48:00 <geist> yah i have LK ported and running on 68k
23:49:00 <heat_> netbsduser ported his OS to m68k too
23:49:00 <Ermine> oh, cool
23:49:00 <geist> aaaand! i just got ahold of a 68030, just need to assemble the board for it
23:49:00 <geist> with 030 i have access to.... PAGING
23:49:00 <geist> MMMMMUUUUU
23:50:00 <Ermine> mmoo
23:50:00 <leg7> OMGGGG IT WORKSSSS
23:50:00 <zid> woot
23:50:00 <leg7> nice
23:50:00 <geist> noice
23:50:00 <Ermine> cool
23:50:00 <leg7> I had the bits reversed for GdtEntryAccessData = 0b000'10'000,
23:50:00 <netbsduser> yes i love all m68k
23:50:00 <leg7> I wrote GdtEntryAccessData = 0b000'01'000,
23:50:00 <zid> do it in userspace next time imo :P
23:50:00 <netbsduser> geist: enjoy
23:50:00 <geist> as much as we just told you the answer, i do low key kinda respect that you wanted to figure it out and not just copy the answer
23:51:00 <netbsduser> i only support 68040/68060 MMUs at the moment, 68030 has a wild one
23:51:00 <leg7> Well it improved my debuggin skills
23:51:00 <leg7> kinda
23:51:00 <geist> netbsduser: yeah i'm always looking out for a good mac SE/30 or an amiga
23:51:00 <geist> but both are pretty difficult
23:51:00 <zid> learning about x /32bx or whaever is a good skill toi have
23:51:00 <leg7> yep
23:51:00 <Ermine> but look, there are bunch of weird arches in linux/arch
23:51:00 <geist> netbsduser: i used to have a next slab with an 030, but i sold it a few years back when i was moving
23:52:00 <leg7> Well I still didn't really learn how to read the interrupt log from qemu
23:52:00 <heat_> a good chunk of those don't really have any good use
23:52:00 <geist> but that's not a real good machine to hack on to be honest
23:52:00 <zid> leg7: just look for old 0xffff
23:52:00 <leg7> but atleast I got a nice gdb setup
23:52:00 <leg7> How do I know what interrupts do what?
23:52:00 <netbsduser> geist: i have an amiga 2000 w/ 68060 card, and i do have a 68030 card somewhere, but it's tedious to swap them
23:52:00 <zid> intel manual
23:52:00 <leg7> https://wiki.osdev.org/Exceptions
23:52:00 <bslsk05> ​wiki.osdev.org: Exceptions - OSDev Wiki
23:52:00 <geist> netbsduser: but yeah you're right the 030 mmu is a bit wonky
23:52:00 <Ermine> but they are still supported, unlike itanium
23:52:00 <leg7> with this?
23:52:00 <zid> ignore the SMM ones those are firmware doing things, you want old 0xffff, new 0xd
23:52:00 <zid> then old 0xd, new 0xe
23:52:00 <zid> etc
23:53:00 <geist> not entirely compatible with 040. or more importantly it appears that the 040 mmu is approximately a subset of the 030
23:53:00 <geist> but not precisely
23:53:00 <netbsduser> i might do some work targeting 68030 under FS-UAE emulation until i get myself a cheap a500 (also fits the same 68030 card i have for the 2000)
23:53:00 <leg7> what is itanium?
23:53:00 <geist> ITANIUMMMMM!
23:53:00 <zid> That's "Previous interrupt was nothing, now we have a #GP", then "Previous interrupt was #GP, now we have page fault", etc
23:53:00 <netbsduser> itanium is going too far
23:53:00 <leg7> I thought it was a name you made up earlier
23:53:00 <zid> then it's just a register dump
23:53:00 <netbsduser> i will not target the itanium
23:53:00 <zid> good news, gcc 14 is dropping itanium
23:54:00 <zid> now that linux has dropped it
23:54:00 <geist> leg7: it's a now dead architecture that intel released in 1999
23:54:00 <zid> For HP
23:54:00 <geist> had a run, didn't make it, died. but it's *bonkers*
23:54:00 <zid> who are the only people who ever used it
23:54:00 <Ermine> intel's first attempt at 64-bit architecture
23:54:00 <geist> but sometimes you'll see IA-64, since that's the official intel name for it
23:54:00 <zid> (which is why we're all using amd's 64bit architecture)
23:54:00 <geist> vs IA-32 or IA-32e, or Intel64 or whatnot
23:54:00 <netbsduser> incredible GCC support for paris, alpha, mips, and even vax will outlast itanium support
23:54:00 <zid> which intel call Intel 64, or EM64, or I32-e, depending on era/manual
23:55:00 <geist> yah though partially because i'm sure itanium support is a mega pain to maintain
23:55:00 <zid> EMT64*
23:55:00 <Ermine> like, why linux still supports alpha
23:55:00 <heat_> EM64T
23:55:00 <netbsduser> in fairness the others are much less remarkable architectures
23:55:00 <geist> actually of all old dead architectures, alpha still has some lgs
23:55:00 <geist> legs even
23:55:00 <heat_> Ermine, sentimental reasons
23:55:00 <leg7> is riscV better?
23:55:00 <heat_> it was the second arch on linux, the first big proof that linux is portable
23:55:00 <nikolapdp> in what way does alpha have legs
23:56:00 <geist> alpha stuff is still *Very* expensive, i think there's a fair amount of folks still needing to maintain old alpha systems
23:56:00 <leg7> like more organized and easier to work with
23:56:00 <nikolapdp> thought it died with dec
23:56:00 <heat_> leg7, better than what?
23:56:00 <leg7> x86
23:56:00 <geist> well, it did and didn't. compaq bought it, and HP killed it later, but i think they continued to manufacture alpha servers through some of the 2000s
23:56:00 <geist> but the ones they made were enterprise grade stuff, so the hardware itself is still solid
23:56:00 <heat_> riscv has less legacy than x86, but the manual reads like something someone wrote on the back of a napkin
23:56:00 <geist> and i think theres some cases where there's a lot of alpha installations floating around
23:57:00 <geist> such that the hardware market is still quite expensive for used alpha stuff
23:57:00 <zid> heat_: back of 12 napkins
23:57:00 <zid> and you have to get them each from a different restaurant
23:57:00 <leg7> damn that bad
23:58:00 <heat_> amd manuals are good, intel manuals are good
23:58:00 <leg7> has anyone of you made a non x86 os?
23:58:00 <geist> but otherwise riscv is so simple it's pretty fun. i've been spending a lot of time in riscv land the last year and it's both fun and terrible but mostly fun
23:58:00 <Ermine> lk supports a lot of stuff
23:58:00 <heat_> arm manuals are like "here are the pieces to your CPU, have fun assembling them"
23:58:00 <geist> like in the way that crappy go-kart some kid down the street had where the wheels would fall off and you had to reach back and manually frob the throttle on the engine
23:58:00 <Ermine> but it's kinda barebones
23:58:00 <geist> but it ran like a bat out of hell
23:59:00 <Ermine> heat_: what is the state of aarch64 in onyx btw?
23:59:00 <geist> Ermine: yah lots of folks build things out of it
23:59:00 <geist> basically 'heres a kernel, here's where you add your code' go for it
23:59:00 <geist> and that seems to satisfy a lot of companies
23:59:00 <Ermine> yes, this is what I meant