<heat>
geist: O0 is funny. for clang it basically makes it into a braindead compiler
<heat>
gcc is less stupid but still bad codegen overall
<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
<geist>
yah that's why i say just having a simple pass to get the basics is pretty useful
<heat>
wow okay even gcc is doing it in this case
<geist>
that was pretty much my experience, i just didnt feel like arguing a while ago
<Mondenkind>
can't you tell llvm to specifically run some passes?
<heat>
probably
<Mondenkind>
mem2reg would do what you want here i think
<heat>
not sure, the variable is unused
<heat>
you don't need a mega-optimizer to look at this and say "oh wow this is not used at all"
<Mondenkind>
mmm yeah but it would at least get rid of the memory accesses
<geist>
right just simple dead code removal and expression collapsing
<Mondenkind>
which are gonna probably be most of what kills you most of the time
cydox has quit [Ping timeout: 268 seconds]
<Mondenkind>
probably most code isn't dead until you do other optimisations
<heat>
i would probably need to run opt with mem2reg
<Mondenkind>
so i doubt _just_ dce would buy you much for most code
<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
<geist>
its here, on the stack, at slot X
<heat>
what are these "simple debuggers" and are they in the room with us tonight
<Mondenkind>
in llvm's case it's just because clang intentionally emits braindead code for simplicity knowing it will be cleaned up later
<Mondenkind>
which is reasonable engineering wise, tbh
cydox has joined #osdev
netbsduser has quit [Ping timeout: 260 seconds]
<heat>
well yes it is llvm's fault
<heat>
llvm O0 is drastically clunky
<heat>
what really annoys me is that cc defaults to O0
<heat>
you can't do $(CC) *.c -o prog without adding a bunch of reasonable compile flags
<heat>
because reasonable defaults are unreasonable
<geist>
well, sure you can, and in a lot of cases prog works fine
<geist>
it's just PESSIMAL
<geist>
which most people dont care
<geist>
so default to the fastest compile, with most debuggability
<heat>
it's probably minimally pessimal because CPUs are maximally great at everything
<heat>
except not having large chunks of microarchitectural state leak. they're not great at that
<bslsk05>
www.cs.cmu.edu: 15-410 Documentation For The Enthusiast
<chiselfuse>
i found this mentioning:
<chiselfuse>
> QEMU obtains better performance than single-instruction intepreters such as Bochs or sub-instruction simulators such as Simics...
<chiselfuse>
but i'm not sure what this means
netbsduser has quit [Ping timeout: 252 seconds]
air has quit [Quit: Client killed by user]
edr has quit [Quit: Leaving]
<geist>
it's because qemu translates runs of instructions into the native instruction set
<geist>
bochs interprets each instruction one at a time
<geist>
and simics is i guess trying to emulate the full microarchitecture of the cpu
masoudd has quit [Ping timeout: 255 seconds]
<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
linearcannon has quit [Ping timeout: 264 seconds]
netbsduser has joined #osdev
Arthuria has joined #osdev
netbsduser has quit [Ping timeout: 272 seconds]
chiselfuse has quit [Remote host closed the connection]
chiselfuse has joined #osdev
air has joined #osdev
craigo has quit [Quit: Leaving]
air has quit [Client Quit]
netbsduser has joined #osdev
air has joined #osdev
netbsduser has quit [Ping timeout: 260 seconds]
Gooberpatrol66 has quit [Remote host closed the connection]
stolen has joined #osdev
netbsduser has joined #osdev
linearcannon has joined #osdev
netbsduser has quit [Ping timeout: 264 seconds]
Arthuria has quit [Ping timeout: 260 seconds]
vdamewood has joined #osdev
nanobot567 has joined #osdev
netbsduser has joined #osdev
bradd has quit [Ping timeout: 255 seconds]
bradd has joined #osdev
netbsduser has quit [Ping timeout: 268 seconds]
ThinkT510 has quit [Quit: WeeChat 4.2.1]
ThinkT510 has joined #osdev
nanobot567 has quit [Quit: Into the abyss I go!]
k0valski18891621 has joined #osdev
netbsduser has joined #osdev
netbsduser has quit [Ping timeout: 252 seconds]
Cindy has quit [Remote host closed the connection]
rustyy has quit [Ping timeout: 272 seconds]
rustyy has joined #osdev
Gooberpatrol66 has joined #osdev
pg12 has quit [Remote host closed the connection]
pg12 has joined #osdev
linear_cannon has joined #osdev
linearcannon has quit [Ping timeout: 260 seconds]
gog has joined #osdev
<chiselfuse>
geist: i find no difference between what you suspected about bochs vs what you suspected about simics
<chiselfuse>
if bochs tries executes instr by instr then it must be emulating the microarch
<geist>
well, not exactly. an instruction at a time is not really emulating the stages of how a cpu would execute instructions
<geist>
simics, i dunno much about it, may be doing sub instruction emulation, like the pipeline of the instructions
<geist>
to get perhaps perfect timing
<gog>
hi
<chiselfuse>
hello
bauen1 has quit [Ping timeout: 246 seconds]
<geist>
a gog!
<geist>
good morning gog
<chiselfuse>
geist: how about qemu? you said bochs does it instr by instr, does qemu do it by instr batch then? :P
<geist>
it dynamically translates instructions to the host
<geist>
and in runs of instructions
<Mutabah>
or uses the host CPU's VM extensions
<chiselfuse>
geist: wouldn't that be letting the host execute code of the guest instr by instr?
<geist>
i'm assuming the host is not the same architecture
<geist>
and indeed, if it's the same architecture and the host OS allows it, QEMU also serves as a virtual machine host
<geist>
in which case the code is indeed running at full speed
<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.
<Mutabah>
in contrast to a simulator like bochs, that is a massive `switch` statement on the opcodes
<chiselfuse>
Mutabah: switch to what? say i have `add eax, 5` on guest, can you give example for this?
<chiselfuse>
just try to execute equivalent instr on host you mean?
<Mutabah>
bochs would have something like `switch(opcode_byte) { case ADD_IMM_AX: regs->EAX += 5; update_flags(); break; ... }`
<Mutabah>
while qemu would generate a block of native code that does the same thing, then jump to it
<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.
<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
<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
<Mutabah>
(huh, that code would be `05 05`)
<Mutabah>
sorry, `05 05 00 00 00` - forgot the zero bytes
<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.
<chiselfuse>
i wonder if this Simics emulates the processors exactly with all possible hidden undocumented things
<chiselfuse>
since intel develops it now
<chiselfuse>
Mutabah: do you know instruction encodings by heart?
<Mutabah>
No, I opened an emulator project I was working on ealier
<geist>
yah i have written a few, but nothing recent
<chiselfuse>
do you think i can get the full Simics?
<chiselfuse>
they ask you to email them for that as far as i can tell
gbowne1 has quit [Quit: Leaving]
navi has joined #osdev
netbsduser has joined #osdev
<geist>
good question
<geist>
*probably* not but it doesn't hurt to ask
theyneversleep has joined #osdev
netbsduser has quit [Ping timeout: 256 seconds]
netbsduser has joined #osdev
theyneversleep has quit [Remote host closed the connection]
GeDaMo has joined #osdev
npc has joined #osdev
netbsduser has quit [Ping timeout: 252 seconds]
<mjg>
have you NERDS seen the fallout tv show?
<gog>
i'm not a nerd
<mjg>
's why i was not asking you mate
<mjg>
anyhow i'm 6 episodes in (out of 8) and it is pretty decent
<gog>
maybe we'll have to put it on our list
<gog>
i've heard it's good
<mjg>
from what i read on the interwebz people who are really into the franchise like it
<mjg>
personally i only played fallout 1 and 2, and even then it was liek 20 years ago
<gog>
i've only really played new vegas
<gog>
but i love it
<gog>
it's one of my fav games
<mjg>
mon totally chheck out OG stuff
<mjg>
you are old enough to be fine with 2d graphics
<mjg>
:d
<gog>
true
<mjg>
anyhow they got the art style right afaics
<zid>
I really like fo1, my friend really likes fo2, we do battle tomorrow at dawn
<gog>
swordfighting in the denny's parking lot
<mjg>
i have no idea how true it is to newer games
<gog>
i've never played fo4
<gog>
or 76
<zid>
fo4 is weird, it's a nice little evolution on fo3's gunplay systems
<zid>
but the story gets 3/4 of the way finished then just... stops
<zid>
The big reveal is about to happen
<zid>
then the guy who would reveal it doesn't, and it ends
<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
carbonfiber has joined #osdev
<zid>
as we all know, the correct game to put lots of hours into is balatro
<gog>
i lost a run on ante 7 this morning
<gog>
i could only win with a flush of clubs
<zid>
I lost to the final boss yesterday, whoopsie, I had a trash deck though
<zid>
surprised it got as far as it did
<gog>
yeh i was playing with a pretty bad set of jokers
<zid>
I'm mainly just looking for my final legendary joker though to finish my collection tab
<gog>
noice
<zid>
I had erm, +1 mult per tarot, and stencil
<zid>
:P
<zid>
and didn't get any good celestial cards for the hand I was playing
<zid>
so I was.. weak
<gog>
oof
<zid>
having to do things like hold justice in hand to pump store
<gog>
stencil is good for like the first few rounds
<zid>
stencil's kinda good midgame
<zid>
early it's too weak imo because you have no flat +mult yet
<gog>
true
<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
<zid>
but if you don't get the celestials or a good money joker it.. rapidly murders you
<zid>
I held on by the skin of my teeth to the final boss with some tricky tarot card banking
<zid>
I've beaten all the challenges and unlocked everything now, except for 1 legendary joker (ironically, probably the best one)
<zid>
and beaten gold stake on a deck
<gog>
wow
zxrom has joined #osdev
netbsduser has joined #osdev
<zid>
if you suck you probably just have POOR MONEY MANAGEMENT
<gog>
yes
<gog>
i do IRL too'
<zid>
Just get to 25 asap and stay above it and game is ez
<zid>
and don't skip much
<FireFly>
just win and it's easy to win
<zid>
just forget to lose
<gog>
never lose
<gog>
losing is for losers
<gog>
if you lose you're a loser
<gog>
and that's a permanent condition you can never change
<zid>
That's how I beat bosses in dark souls, just keep my hp above 0 duh
<gog>
roll
<zid>
rolling is MID
<gog>
so am i
<zid>
man, I wanna play sekiro again now
<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
<zid>
then you can just restart if it's shit if you like
<gog>
you need 75 points x4 for a flush to get you max monies
<gog>
that's pretty easy
<zid>
yup
<gog>
a flush is 35x4
<zid>
so you need 40 from the cards you played, two bigs and 3 littles
heat has joined #osdev
<heat>
i fell asleep watching a video on my watch later playlist
stolen has quit [Quit: Connection closed for inactivity]
<netbsduser>
what sort of heap gog
<gog>
like malloc()/free()
<gog>
memory heap
<netbsduser>
who for?
<gog>
myself
<gog>
NIH
<heat>
slab slab slab slab slab slab
<heat>
or slub
<heat>
slub slub slub slub slub
<heat>
slub on deez nutz
<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
<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
<gog>
holy shit zid
<gog>
yaaaas queen
<gog>
heat i am not a slub
<gog>
don't slub shame me
<zid>
four steel kings with red seal pretty good with 4 copies of baron
<heat>
slab is a horrible horrible choice for most userspace programs
<gog>
i only have mmap() rn
<gog>
but i don't need whoel pages
<gog>
well, i do, but not for the specific thing i'm working on
<heat>
slab is also called the queen of memory consumption, and that doesn't go hand-in-hand with userspace
<gog>
no matter i have to start house cleaning anyway
vdamewood has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
heat has quit [Ping timeout: 250 seconds]
npc has quit [Ping timeout: 256 seconds]
<zid>
mechanical pencils? In *MY* pencilcase? It's more likely than you think.
spareproject has joined #osdev
SGautam has joined #osdev
goliath has joined #osdev
duckworld has quit []
flom84 has joined #osdev
duckworld_ has joined #osdev
flom84 has quit [Quit: Leaving]
Rubikoid has quit [Ping timeout: 246 seconds]
<mjg>
i finished fallout (the show), 8.5/10 from me
<mjg>
provided you accept the whacky comedy
goliath has quit [Quit: SIGSEGV]
duckworld_ has quit []
randm has quit [Remote host closed the connection]
randm has joined #osdev
duckworld_ has joined #osdev
duckworld_ has quit [Client Quit]
duckworld has joined #osdev
xenos1984 has quit [Read error: Connection reset by peer]
CryptoDavid has joined #osdev
flom84 has joined #osdev
flom84 has quit [Client Quit]
xenos1984 has joined #osdev
masoudd has joined #osdev
craigo has joined #osdev
SGautam has quit [Quit: Connection closed for inactivity]
duckworld has quit [Remote host closed the connection]
duckworld has joined #osdev
duckworld has quit [Remote host closed the connection]
duckworld has joined #osdev
rutvik has joined #osdev
kof673 has joined #osdev
rutvik has quit [Remote host closed the connection]
carbonfiber has quit [Quit: Connection closed for inactivity]
<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
<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
* Ermine
slabs
<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
<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 :/
<kof673>
32M is fine IMO, but linux maybe could make a smaller image easier
gildasio has quit [Remote host closed the connection]
gildasio has joined #osdev
heat has joined #osdev
tomaw has quit [Read error: Connection reset by peer]
<kof673>
*not sure ghc6 can run on any version of freebsd 3.x, to build binaries against freebsd 3.x libc
<mjg>
dafaq you doin mate
<kof673>
they are just useful for pre-lto c compilers lol
<kof673>
still need to add some gcc to the 5.4 image for cmix to work, but the generated sources should all be "generic"
<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
<kof673>
*their
<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
tomaw_ has joined #osdev
<kof673>
if not, might still work if your target is "close enough" lol
tomaw_ is now known as tomaw
<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.
<kof673>
*assuming you only write c89
<kof673>
:D
<kof673>
modern toolchains should do everything cmi and knit "flattening" feature do, cmix is perhaps more useful (again, c89 only lol)
theyneversleep has joined #osdev
spareproject has quit [Ping timeout: 246 seconds]
<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
<kof673>
so, one piece to slowly build up synthesis os-alike in C89 lol
<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
Arthuria has joined #osdev
theyneversleep has quit [Ping timeout: 260 seconds]
npc has joined #osdev
<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"
<kof673>
so it has fine-grained dependencies/build system but too much work IMO
<kof673>
but theory is you could specify different "backends" whatever to implement a component, and the build system would handle that
<kof673>
*my understanding, may be way off
<kof673>
and stuff for initializing components in a required order, etc.
<gog>
hi
<heat>
gog
<gog>
heat
Arthuria has quit [Ping timeout: 260 seconds]
<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
<kof673>
so just having a VM to keep around is easier IMO
<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 :)
<kof673>
i would prefer wasm or something of course, but this will work in the meantime lol
heat has quit [Ping timeout: 250 seconds]
nanobot567 has joined #osdev
<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
<kof673>
or, ideally these "program transformation" programs would be a compiler plugin or something, and not target-specific, generic source code "transformers" :/
heat has joined #osdev
<Ermine>
heat gog
<heat>
Ermine
<gog>
Ermine heat
<gog>
c69
<heat>
hehehe nice
<Ermine>
the best language ever
<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)
netbsduser has quit [Ping timeout: 255 seconds]
netbsduser has joined #osdev
goliath has joined #osdev
gog has quit [Ping timeout: 255 seconds]
zetef has joined #osdev
nanobot567 has quit [Quit: Into the abyss I go!]
nanobot567 has joined #osdev
masoudd has quit [Killed (NickServ (GHOST command used by masoudd_))]
masoudd_ has joined #osdev
zetef has quit [Ping timeout: 246 seconds]
masoudd_ is now known as masoudd
<geist>
gog Ermine heat
<heat>
geist gog Ermine heat
<heat>
rust 2069
<heat>
i want to implement readahead
<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
<bslsk05>
hackaday.com: Git Good, By Playing A Gamified Version Of Git | Hackaday
nanobot567 has quit [Ping timeout: 268 seconds]
<mjg>
oh no
<heat>
sorry i don't use git i use got
nanobot567 has joined #osdev
<geist>
i haven't played it but it looks cute
<mjg>
does it showcase legit uses though
<mjg>
or does it facilitate the usual spaghettification of the repo
<mjg>
really the biggest problem with git is protecting beginners from themselves
CryptoDavid has quit [Quit: Connection closed for inactivity]
masoudd has quit [Ping timeout: 246 seconds]
<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
<geist>
the local index getting all fucked up
<mjg>
dude
<mjg>
total classic is the following: person makes a change on master, does git pull, that results in a spurious merge commit
<mjg>
and they push that
<mjg>
arguably does not make spaghetti, just garbage in git log
<geist>
sure, but it's not fatal, it's just a silly merge commit
<geist>
and yeah i 99% of the time force a rebase
<mjg>
multiple by every person and every other commit they make
<geist>
alas it's pretty much the default pattern on github with pulls
<mjg>
i was part of a project so riddled with this shit i felt SAD
carbonfiber has joined #osdev
rutvik has joined #osdev
navi has quit [Quit: WeeChat 4.2.1]
<Ermine>
but does anybody use readahead?
<geist>
i assume heat is talking about the fact that the OS silently readaheads for you
<geist>
so that the data is already cached and ready to go
<Ermine>
Ah, probably
heat has quit [Quit: Client closed]
<Ermine>
I thought about its explicit version
Arthuria has joined #osdev
<Ermine>
Aand systemd dropped its support for quite a while ago
heat has joined #osdev
<mjg>
makes you wonder how effective is it tho
<heat>
how effective what is
<mjg>
windows 98 on a modern pc
<heat>
very
netbsduser has quit [Remote host closed the connection]
netbsduser has joined #osdev
rutvik has quit [Quit: Konversation terminated!]
<geist>
oh that's true, heat could have been talking about boot time readahead
<geist>
i guess we'll never know. heat is an enigma
<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" :)
<heat>
i was talking about the automagic readahead yeah
<kof673>
*cygwin/mingw/whatever
<Ermine>
i wonder if virtio-gpu supports directx somehow
bauen1 has joined #osdev
nanobot567 has quit [Ping timeout: 260 seconds]
<heat>
the vulkan one must
<Ermine>
?
gog has joined #osdev
<heat>
?
<Ermine>
> the vulkan one must
gog has quit [Ping timeout: 255 seconds]
Arthuria has quit [Killed (NickServ (GHOST command used by Guest684531))]
Arthuria has joined #osdev
<heat>
whats the question
gbowne1 has joined #osdev
hbag has joined #osdev
<geist>
doesn't look like directly, but i suppose you could transliterate to vulkan or whatnot
<leg7>
either that or the nasm function is incorrect
<zid>
I am being dumb or something
<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.... :/
<bslsk05>
www.gnu.org: DDD - Data Display Debugger - GNU Project - Free Software Foundation (FSF)
<kof673>
*the arrow is pointing at the 1995 date for the article
<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
<zid>
why tmp, like I passed -pipe even though I didn't, and where is the 64bit .o sneaking in
<zid>
I literally did find . -name "*.o" | xargs file and they're all 32
<zid>
the also your run to build .o from .s seems like it isn't being used
<zid>
rule*
<heat_>
found it
<heat_>
./kernel/multiboot.s
<heat_>
pass -m32
<zid>
oh did I not have -m32 in that one, just the cflags one.. fuck
<leg7>
if you do `make run` in one terminal it will execute that
<zid>
I do not have
<zid>
qemu-system-i386
<zid>
or an iso
<leg7>
and open gdb in another while in src and it will auto connect
<leg7>
I'm sorry I thought you were debuggin my os
<zid>
I am.
<leg7>
oh
<zid>
I do not have your weirdo tools.
<zid>
I have 64bit qemu, because.. why wouldn't I
<heat_>
how do you not have qemu-system-i386?
<heat_>
those two are usually packaged together
<heat_>
like, x86_64 is literally just a superset
<zid>
packaged? lol
<zid>
fuck, I don't have i386 gdb
<leg7>
gentoo life
<zid>
workedaround
<zid>
why are you loading 8 into ss at all
<zid>
this makes no sense
<leg7>
I followed a tutorial
<zid>
oh that'd do it
<zid>
is cs loaded with 16 then?
<zid>
nope, also 0x8
<zid>
you're putting your code selector into cs, then putting your code selector into all other regsiters too
<zid>
try putting the.. data selector into those ones
<leg7>
shouldn't ebp+12 be the data selector?
<zid>
idk, you're loading 8 into it
<leg7>
I meeanm
<leg7>
ebp+14
<heat_>
why is this configurable at all?
<heat_>
just hardcode it
<leg7>
the tutorial I followed leaded ebp+16
<zid>
I also cannot copy paste from gdb, heat
<leg7>
but I think that's just wrong
<zid>
cus layout asm is really really fucky
<heat_>
using gdb tui is pebkac
<geist>
they probably put the gdt pointer on the stack?
<leg7>
because the params are 32 bit 16 bit 16 bit
<geist>
and then did a lgdt or it
<zid>
I should have used gef but idk if it supports 32bit
<zid>
ebp+12 is '8'
<leg7>
yeha
<zid>
which is your code selector, seeing as that's what's in cs
<geist>
oh i see loading the cs
<leg7>
and since it's 16 bit shouldn't ebp+14 be 16?
<zid>
info registers cs: cs 0x8 8
<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
<zid>
that's 0.. can you push shorts in your abi?
<zid>
+16 is 0x10
<leg7>
What?
<leg7>
why?
<zid>
ebp+12 is 8, ebp+16 is 16
<leg7>
does c code not push shorts?
<zid>
it's not C that's responsible for this, it's the ABI
<zid>
hell, in long mode you physically *can't* push chars, for example
<zid>
no worky
<leg7>
I mean gcc usses sys V abi?
<leg7>
right
<leg7>
and the sys V abi pushes shorts
<heat_>
yes this is a sysv abi detail
<leg7>
no?
<heat_>
no
<leg7>
damn
<leg7>
ok
<leg7>
but it still crashes with ebp+16
<leg7>
I tried that earlier
<zid>
where do I change that
<leg7>
and tried it again
<geist>
it's behavior of the stack, the cpu itself will align the stack when you push it
<geist>
based on the mode its in
<heat_>
your gdt is fucked, i'm telling you
<heat_>
i told you to check my gdt, you didn't
<leg7>
ok yes the stack is algined on 4
<leg7>
I remember
<zid>
if loading 0x10 also fails, that selector is broken
<zid>
where do I edit it to try that
<heat_>
the gdt looks nothing like a normal 32-bit gdt
<leg7>
What do you want to edit?
<zid>
I want to load 0x10 not 0x8, you seemed to have 'fixed' a stack misalignment bug somewhere
<zid>
where
<leg7>
you can edit Gdt.nasm
<zid>
wher eis that
<leg7>
kernel/memory/
<zid>
..naturally
<leg7>
src/kernel/memory/Gdt.nasm
<leg7>
change ebp+14 to ebp+16
<leg7>
line 21
<leg7>
char 22
<zid>
loading ds with 0x10 faults
<zid>
That selector is.. 0x5f8b000000ffff
<geist>
i concur with heat_ . your gdt is probably broken, also did you make sure your lgdt is long enough?
<geist>
the length part
<zid>
it's 0x18 which is long enough for 3 entries right?
<geist>
yah
<leg7>
I'll push my changes
<heat_>
yes but the entries are completely borked
<geist>
(though i think it's -1)
<zid>
it's off by 1 though
<zid>
should be 0x17
<geist>
but it being one byte too long should be fine
<zid>
yea
<zid>
I want my gdt.html back :(
<geist>
so yeah lets get that gdt fix
<geist>
leg7: did you derive the gdt from scratch or get it from somewhere else?
<leg7>
I pushed the fixes
<leg7>
so far
<leg7>
I followed a tutorial loosely but I wrote some stuff myself
<geist>
what about the contents of the gdt itself?
<geist>
side note, what tutorial was it?
<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
<zid>
It's very blazé to do it in-kernel with limited debug functionality, when it's so easily tested otherwise
<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
<leg7>
This is my first OS so I supposed I would need it later
<geist>
hmm, those bitfields may be doing it
<geist>
are you sure the two 4 bit fields are sorted that way?
<zid>
Those all need extending to ULL if you shift them btw
<geist>
re: flags and limit 19:16
<leg7>
wdym sorted?
<geist>
well, bitfields are ABI defined how they pack
<zid>
A then B, or B then A
<geist>
right
<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
<zid>
and if you do `some_u8 << 32` that gives 0
<zid>
you need some_u8 to be an unsigned long for big shifts, just fyi
<geist>
so you might need to do flags before limit in your GDT structure
<geist>
zid: they're not using anything larger than 8 in this case, so shouldn't be an issue
<zid>
I can't really read it right now, so I'm just throwing shit out
<geist>
i'm specifically talking about
<geist>
u8 limitHigh : 4;
<geist>
u8 flags : 4;// defined like access
<zid>
I'm having a migraine so I can't see most of my screen
<geist>
in the packed GdtEntry struct
<geist>
zid: ugh, i'm having more of those lately. i tried to code the other day while having an vision migrane
<geist>
no bueno, can watch lightweight youtube vids
<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
<geist>
scintillating scotoma
<zid>
yep
<geist>
yah i get one maybe once a month or so. no obvious cause
<zid>
I got precisely 0 in my 20s
<zid>
but have had them in my teens and 30s, odd
<geist>
oh i didn't get my first one until i was like 40
<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
<geist>
when the lightning bolt crosses the center of my vision i basically cant read anything, but otherwise it's mostly annoying
<geist>
but usually moves off my vision in about 30 minutes
<geist>
leg7: so what value did you read from gdt?
<leg7>
Well I posted a screenshot a couple times I'll post it again
<geist>
yyah i'm really not going to try to go back and figure out what the last, correct, screenshot is
<zid>
I'd probably just do it in reverse in userspace
<zid>
data = 0xcf9a...FFFF; then dump all the fields back out and make sure they have the bit pattern I expect
<geist>
but yeah it checks out. from what i can read fro the gdt.h file
<geist>
aside from the bitfield
<Ermine>
Libbsd release notes: > fix build on gnu/hurd, > fix build on musl
<bslsk05>
wiki.osdev.org: Exceptions - OSDev Wiki
<geist>
netbsduser: but yeah you're right the 030 mmu is a bit wonky
<Ermine>
but they are still supported, unlike itanium
<leg7>
with this?
<zid>
ignore the SMM ones those are firmware doing things, you want old 0xffff, new 0xd
<zid>
then old 0xd, new 0xe
<zid>
etc
<geist>
not entirely compatible with 040. or more importantly it appears that the 040 mmu is approximately a subset of the 030
<geist>
but not precisely
<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)
<leg7>
what is itanium?
<geist>
ITANIUMMMMM!
<zid>
That's "Previous interrupt was nothing, now we have a #GP", then "Previous interrupt was #GP, now we have page fault", etc
<netbsduser>
itanium is going too far
<leg7>
I thought it was a name you made up earlier
<zid>
then it's just a register dump
<netbsduser>
i will not target the itanium
<zid>
good news, gcc 14 is dropping itanium
<zid>
now that linux has dropped it
<geist>
leg7: it's a now dead architecture that intel released in 1999
<zid>
For HP
<geist>
had a run, didn't make it, died. but it's *bonkers*
<zid>
who are the only people who ever used it
<Ermine>
intel's first attempt at 64-bit architecture
<geist>
but sometimes you'll see IA-64, since that's the official intel name for it
<zid>
(which is why we're all using amd's 64bit architecture)
<geist>
vs IA-32 or IA-32e, or Intel64 or whatnot
<netbsduser>
incredible GCC support for paris, alpha, mips, and even vax will outlast itanium support
<zid>
which intel call Intel 64, or EM64, or I32-e, depending on era/manual
<geist>
yah though partially because i'm sure itanium support is a mega pain to maintain
<zid>
EMT64*
<Ermine>
like, why linux still supports alpha
<heat_>
EM64T
<netbsduser>
in fairness the others are much less remarkable architectures
<geist>
actually of all old dead architectures, alpha still has some lgs
<geist>
legs even
<heat_>
Ermine, sentimental reasons
<leg7>
is riscV better?
<heat_>
it was the second arch on linux, the first big proof that linux is portable
<nikolapdp>
in what way does alpha have legs
<geist>
alpha stuff is still *Very* expensive, i think there's a fair amount of folks still needing to maintain old alpha systems
<leg7>
like more organized and easier to work with
<nikolapdp>
thought it died with dec
Matt|home has quit [Quit: Leaving]
<heat_>
leg7, better than what?
<leg7>
x86
<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
<geist>
but the ones they made were enterprise grade stuff, so the hardware itself is still solid
<heat_>
riscv has less legacy than x86, but the manual reads like something someone wrote on the back of a napkin
<geist>
and i think theres some cases where there's a lot of alpha installations floating around
<geist>
such that the hardware market is still quite expensive for used alpha stuff
<zid>
heat_: back of 12 napkins
<zid>
and you have to get them each from a different restaurant
<leg7>
damn that bad
<heat_>
amd manuals are good, intel manuals are good
<leg7>
has anyone of you made a non x86 os?
<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
<Ermine>
lk supports a lot of stuff
<heat_>
arm manuals are like "here are the pieces to your CPU, have fun assembling them"
<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
<Ermine>
but it's kinda barebones
<geist>
but it ran like a bat out of hell
<Ermine>
heat_: what is the state of aarch64 in onyx btw?
<geist>
Ermine: yah lots of folks build things out of it
<geist>
basically 'heres a kernel, here's where you add your code' go for it
<geist>
and that seems to satisfy a lot of companies