<bslsk05>
gcc.gnu.org: GCC 13 Release Series — Changes, New Features, and Fixes - GNU Project
<heat>
ew
<heat>
wdym "looks proper"
<heat>
it doesn't even have dark mode
<heat>
just raw whitey html
<zid>
web 1.0
<zid>
aka back when it still worked
<heat>
sphinx also just works
<mjg>
you can't handle the truth table
<heat>
btw happy your back
<heat>
you're*
<heat>
that mjg_ just sucked
<poisone>
double mjg;
<heat>
this is nofpu code
<mjg>
i'm a self help guru now
<mjg>
1. STAY HARD
<heat>
hardbsd
<heat>
better known as OPENBSD
<gog>
girlbsd
<heat>
we need a female ran operating system
<heat>
maybe it wouldn't crash so much
<heat>
or have such shit code
[itchyjunk] has quit [Ping timeout: 260 seconds]
[itchyjunk] has joined #osdev
Matt|home has quit [Quit: Leaving]
<mjg>
gOgginS
<mjg>
i would use that
<gog>
well, if i'm in charge of it it would still have shit code
<heat>
forking from bsd will always give you shit code
<heat>
fork Onyx instead
<heat>
highly good very good code
<gog>
top quality best codes
<heat>
believe me folks, i have the best code, best code in the whole world
<gog>
i'm gonna write my own bsd but i'm gonna fork it from something very old
<heat>
yessssssssss
<heat>
slay queeeen
<mjg>
gog: someone alredy did that, believe it or not
<gog>
well shit
<mjg>
they made an embedded-focused bsd out of the vax-era shit
<mjg>
can't remember the name
<mjg>
i guess an interesting, but flawed choice
<gog>
yeah i was just reading about 3BSD and the VAX era lol
<gog>
that seemed like the most reasonable starting point
<mjg>
VAX MOTHERF
<mjg>
UCKER
<mjg>
gonna port SOLARIS to VAX
<gog>
why would you abuse a vax like that
<gog>
you're a sick person
<heat>
“Look, having UNIX — my uncle was a great professor and scientist and engineer, Dr. Marshall McKusick at Berkeley; good genes, very good genes, OK, very smart, the University of California, very good, very smart —you know, if you're a microkernel fan, if I were a rust developer, if, like, OK, if I wrote a rust microkernel, they would say I'm one of the smartest people anywhere in the world — it's true! — but when you're a conserva
<heat>
tive UNIX monolithic kernel fan they try — oh, do they do a number — that's why I always start off: Went to Berkeley, was a good student, went there, went there, did this, built an operating system —you know I have to give my like credentials all the time, because we're a little disadvantaged — but you look at the operating systems out there, the thing that really bothers me — it would have been so easy, and it's not as important
<heat>
as these lives are UNIX is powerful; my uncle explained that to me many, many years ago, the power and that was 50 years ago; he would explain the power of what's going to happen and he was right — who would have thought?), but when you look at what's going on with the four microkernels — now it used to be three, now it's four — but when it was three and even now, I would have said it's all in the messenger; fellas, and it is fellas bec
<heat>
ause, you know, they don't, they haven't figured that the women are smarter right now than the men, so, you know, it's gonna take them about another 150 years — but the rust developers are great negotiators, the microkernel fans are great negotiators, so, and they, they just killed, they just killed us.”
<heat>
i needed this
<gog>
one might be surprised to learn this about me
<gog>
but i have no interest in rust
<heat>
thank you
<gog>
memory safety is for cowards
<heat>
fuck memory safety and fuck your separate address spaces
<mjg>
fuck your rings
* mjg
goes full templeos
<gog>
yes
<gog>
a unified address space
<heat>
terry had great quotes
<mjg>
indeed he did
<heat>
that unfortunately are not safe to post
<heat>
still great quotes though
<mjg>
his benchmarks are not safe to post man
<mjg>
for real
<mjg>
was very negatively surprised by what he pulled of
<mjg>
f
<heat>
lmao
<heat>
god has pessimal code
<mjg>
example: he wanted to bench whether optmizing code for size in his compiler makes any sense
<mjg>
to that end he wrote a bench which just looped over a small code sample
<mjg>
the cpu was able to cache and decode all of it
<mjg>
... meaning he ultimately did not benchmark what he intended
<mjg>
on one hand pretty weird, on another i keep seeing this: someone otherwise capable of writing non-trivial code pulls off a total idiocy when it comes to performance
wootehfoot has quit [Quit: Leaving]
<mjg>
i don't understand ohw that keeps happening
gog has quit [Quit: byee]
elastic_dog has quit [Killed (erbium.libera.chat (Nickname regained by services))]
elastic_dog has joined #osdev
ZombieChicken has joined #osdev
dutch has quit [Ping timeout: 260 seconds]
spikeheron has joined #osdev
isaacwoods has quit [Quit: WeeChat 3.7.1]
spikeheron has quit [Quit: WeeChat 3.0]
jjuran has quit [Ping timeout: 268 seconds]
spikeheron has joined #osdev
jjuran has joined #osdev
vdamewood has joined #osdev
Raito_Bezarius has quit [Ping timeout: 252 seconds]
<heat>
mjg, because performance is hard
<mjg>
cmon dawg. there is hard aspects and there is being incredibly naive about it
<heat>
you can also halfass things if you wanna get some real progress done
<clever>
Mutabah: ive found this in a json file before, but i dont think it was bit-rot on-disk
<Mutabah>
looks like a bit-flip?
<Mutabah>
0x72 -> 0x76
<clever>
yep, if you convert the ascii to binary, its a single bit, yep
<clever>
but this file is stored on zfs, with both compression and checksums
<clever>
if the bit flipped on disk, the lz4 would not have undone, and the checksum would have failed
<Mutabah>
"bit-rot" usually (well... to me) refers to knock-on changes making something no longer useful/usable
<clever>
i believe it flipped in dram
<Mutabah>
E.g. if something hasn't been compiled/run for a long time
<clever>
ah, more like code just not being compatible
<Mutabah>
Might be an overloaded term...
<clever>
thats why ipxe doesnt use #ifdef for its config
<clever>
ipxe compiles all code always, and then decides at link time if it should include a given .o or not
<clever>
so if you break the compatability between modules, it fails, even if your never using them
<Mutabah>
Ooh, nice idea
<Mutabah>
I got quite salty at work last week after discovering that some automated tests (written early in the project... like, a year ago) were not only not being run, but also had substantially bitrotted
<clever>
modules find eachother the same way little-kernel does, put a bunch of structs into a special .data.foo section, and then get start/end pointers from the linker
<clever>
and you can iterate over every foo the linker included in the project
<Mutabah>
... this was after I suggested some basically-cosmetic changes to a merge request, and they were rejected with the reason "I can't test this easily - we know the current code works [from testing on real hardware]"
<clever>
ouch
<clever>
i try to keep CI running tests always
<clever>
but yeah, some things cant be tested without hardware (or better emulators)
<Mutabah>
yeah... thankfully, I was low on tasks - so tomorrow (Monday) I'm going to complete fixing of those tests
<Mutabah>
(and add them to the CI)
<Mutabah>
(f___ing hell, we designed this system to be developer testable - WHY DID THE TESTS GET FORGOTTEN)
<clever>
in the past, i made a whole test framework using qemu, that would spin up a cluster and run some tests
<clever>
then i discovered, the CI machines in aws cant use /dev/kvm, no nested virtualization in aws at the time
<clever>
and with tcg emulation, the clocks drift out of sync so fast the test fails every time
<Mutabah>
Oof
<clever>
the devs later made better tests, that didnt need qemu
<clever>
so the emulation doesnt matter anymore
elastic_dog has quit [Read error: Connection reset by peer]
elastic_dog has joined #osdev
Matt|home has joined #osdev
<klange>
Mutabah: good, good, now... add an artifact upload stage (it is, amazingly, free)
<klange>
I do build-on-push with artifact uploads, which are public but need to be logged in to github to see them, and I also automatically attach those builds to tagged releases and draft release notes; it's quite the whiz-bang automation
<Mutabah>
Probably should
<Mutabah>
but distracted now :)
potash has quit [Ping timeout: 260 seconds]
potash has joined #osdev
<vin>
Why are standards like CXL/UCIe becoming prominant now? I.e. allowing PCIe to be byte addressable.
terminalpusher has joined #osdev
bgs has joined #osdev
wootehfoot has joined #osdev
Brnocrist has joined #osdev
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
spikeheron has quit [Quit: WeeChat 3.7.1]
spikeheron has joined #osdev
gog has joined #osdev
wootehfoot has quit [Read error: Connection reset by peer]
gareppa has joined #osdev
bradd has quit [Ping timeout: 268 seconds]
gareppa has quit [Read error: Connection reset by peer]
gareppa has joined #osdev
gareppa has quit [Remote host closed the connection]
gareppa has joined #osdev
[itchyjunk] has joined #osdev
elastic_dog has quit [Ping timeout: 240 seconds]
elastic_dog has joined #osdev
rwxr-xr-x has joined #osdev
vdamewood has quit [Read error: Connection reset by peer]
vdamewood has joined #osdev
srjek|home has joined #osdev
rwxr-xr-x has quit [Remote host closed the connection]
rwxr-xr-x has joined #osdev
ElementW has quit [Ping timeout: 248 seconds]
<rwxr-xr-x>
Hello all!
<rwxr-xr-x>
How's it going?
<GeDaMo>
Hi rwxr-xr-x :)
<rwxr-xr-x>
Hello!
<rwxr-xr-x>
First time using IRC, seems pretty chill
<GeDaMo>
If by "chill" you mean quiet, it varies :P
<rwxr-xr-x>
I've joined a few different channels, they are remarkably quiet, that's for sure, there are a lot of people here though, which is surprising
<rwxr-xr-x>
Every channel i've been in have been very welcoming, which is mostly what I was referring to, there is no gatekeeping, very nice
<GeDaMo>
You can search channel names with /msg alis list *pattern* or channel topics with /msg alis list * -topic *pattern*
<GeDaMo>
You can add -min 10 to only show channels with at least 10 nicks
<rwxr-xr-x>
Hey that's pretty cool
<rwxr-xr-x>
I was just using list and combing through lol
<GeDaMo>
:)
<rwxr-xr-x>
:)
<GeDaMo>
You can see the biggest channels with /msg alis list * -min 500
<rwxr-xr-x>
Nice, thanks!
<GeDaMo>
A lot of people doesn't guarantee a lot of activity though :P
<rwxr-xr-x>
yeah, i was just looking at the logs for osdev, last activity before I jumped in was 4 hours ago
<GeDaMo>
It depends on who's on / awake
<rwxr-xr-x>
yeah, nobody gets kicker out for being afk
<rwxr-xr-x>
kicked*
<GeDaMo>
Some people use a bouncer, a proxy which stays connected even if they're offline
<rwxr-xr-x>
neat
<rwxr-xr-x>
why so?
<rwxr-xr-x>
they can just recconnect can they not? Reading old messages?
<GeDaMo>
Yes but if you disconnect, you won't see message from that time
<GeDaMo>
The bouncer keeps a log
<rwxr-xr-x>
gotcha
<GeDaMo>
Your client may have a way to hide join and part messages, those can get annoying in a busy channel
<rwxr-xr-x>
Yeah mine does
<rwxr-xr-x>
Okay, I've got an actual OSDev question now lol
<rwxr-xr-x>
So i've just gotten to the point of switching from 16-bit real to 32-bit protection mode
<rwxr-xr-x>
and I'm using QEMU
<rwxr-xr-x>
I have it print a line in 16-bit real, then one in 32-bit prot when it switches, problem is it flickers like crazy, which i'm guessing is because qemu isn't letting the program print where it wants to, which is the top left corner, overwriting whatever is there, i can spam the pause button and every once in a while see it print the 16-bit real message, im not seeing the 32 bit one though, is it QEMU or my code?
<rwxr-xr-x>
im learning with Nick Blundell's "Writing a simple Operating System -- from Scratch"
<GeDaMo>
Is it triple faulting and restarting?
<GeDaMo>
What does your program do after writing to the screen?
<rwxr-xr-x>
It doesn't appear to triple fault, let me take a closer look
<rwxr-xr-x>
All of the text qemu prints is flashing multiple times a second, text like "booting from hard disk" is partly disappearing, and the cursor is jumping from below the booting message to different parts of the left side of the screen
<rwxr-xr-x>
and its printing the 16 bit real mode message every 10 or so seconds
<zid>
are you using bios routines to print text
<zid>
or writing to vga memory
<rwxr-xr-x>
16 bit is using bios routines, 32 is using vga memory
<zid>
and which one was flickering, 32?
<rwxr-xr-x>
The program starts in 16, prints a message, switches to 32, prints a message, then loops
<zid>
and which one was flickering, 32?
<rwxr-xr-x>
I think 32
<zid>
you.. think? the messages are different I'd hope
<rwxr-xr-x>
It only shows the 16 bit message
<zid>
okay so your 32bit code is just totally broke
<rwxr-xr-x>
the instant it starts qemu, it flashes ridiculously fast, and occasionally prints the 16-bit message
<zid>
throw a binary out somewhere I wanna see :P
<rwxr-xr-x>
i can do 2 things, i can package the asm files together or send a compiled binary
<rwxr-xr-x>
what works better?
<zid>
the latter
<rwxr-xr-x>
alright, one moment
<zid>
I don't want to have to replicate your toolchain
<zid>
I never do 32bit stuff so idk what good selectors look like though :P
<rwxr-xr-x>
its whooping my ass
<zid>
your 8 selector looks okay in my tool though
<rwxr-xr-x>
16 bit was easy lol
<rwxr-xr-x>
having a bios doing shit for you is very nice
<zid>
present, ring 0, code/data, executable, writeable
<zid>
32-bit
<rwxr-xr-x>
I was looking at it right now
<rwxr-xr-x>
thought that might be the issue as well
<rwxr-xr-x>
its correct
<zid>
yea it's definitely unhappy with it though
<rwxr-xr-x>
Code segment: 10011010b & 11001111b
<zid>
it's faulting trying to load it into cs
<rwxr-xr-x>
Data Segment: 10010010b & 11001111
<rwxr-xr-x>
yeah its very weird
<zid>
I have a paper copy of the 32bit manual but
<zid>
it's heavy and I am sat down
<rwxr-xr-x>
for a second I thought it was because of my descriptor, i add the start and end and sub 1 from it
<rwxr-xr-x>
lol
<zid>
gist.github.com the gdt declarations and code that loads it?
<zid>
the lgdt bit and the gdt: dq 0 dq .. nonsense
<rwxr-xr-x>
its where i calc the size of the gdt, adding the start and end of it together then subbtracting 1 because its always less than 1 of the true size
<zid>
yea your gdt may be too short, for example
<zid>
actually qemu prints the limit I think
<zid>
your limit is fucky but I think fine, you have it set to 25 bytes
<zid>
which is enough for cs to load correctly, but I would fix it
Burgundy has joined #osdev
<rwxr-xr-x>
yeah, 0xffff
<zid>
paste paste paste
<zid>
gist.github.com preferable but if you don't use github then whatever's fine
<zid>
so 92 is rw, 9a is exec/read, the others are +conform or +accessed or both
<gog>
i know why 9f is in my head, because that's what a 9a becomes after you load and jump into it
<theWeaver>
who da fuq is turning 9a to 9f after you load and jump to it >:o
<gog>
wait no it doesn't idk
<gog>
ignore me i'm not thinking clearly
<zid>
accessed adds 1 :P
<gog>
yes
<zid>
so it'd turn to 9b, 9b + comforming = 9f
<gog>
yes that's right
<gog>
theWeaver: ask the designers of the 286
<gog>
they're the reason we have this mess
<zid>
I had a very similar bug in my gdt impl actually
<zid>
I forgot to mask in one of the bytes correctly
<gog>
classic gdt bug
<zid>
so it worked for weeks until I re-compiled and some addresses moved around, and my limit was no longer enough because I had it set to 00ff not ffff or something
<zid>
suddenly GPF while doing something innocuous
rwxr-xr-x has quit [Remote host closed the connection]
<gog>
oops
rwxr-xr-x has joined #osdev
<zid>
whale cum back
<rwxr-xr-x>
tyty
<rwxr-xr-x>
accidentally closed my client lol
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<zid>
oh right this explains where that extra 00 on the end came from now
<zid>
it was actually an extra 00 in the middle and it was supposed to be there
<zid>
duh
jimbzy has quit [Ping timeout: 255 seconds]
<zid>
In other words finally huzzah, 100 wins in fortune's foundation
xenos1984 has quit [Ping timeout: 256 seconds]
xenos1984 has joined #osdev
xenos1984 has quit [Ping timeout: 260 seconds]
poisone has quit [Ping timeout: 268 seconds]
<zid>
rwxr-xr-x: how goes it then? you're holding out on us, we're invested now.
<rwxr-xr-x>
Okay so since i'm blind i didn't see the messages until now, i just now fixed it, it only prints the 16 bit message, but doesn't crash
<bslsk05>
bugs.gentoo.org: 647570 – app-emulation/qemu-2.11.0 should have USE=capstone
<zid>
apparently it either never got merged, or the fix doesn't fix it anymore
<rwxr-xr-x>
so wait, i've lost the flow in all these messages, moving ax into ss causes a fault because its illegal.. why?
<zid>
what's in ax
<zid>
(hint: 0xf)
<rwxr-xr-x>
dw 0x0 - dd 0x0, right?
<zid>
don't guess
<zid>
qemu printed it, and if you scrolled it all off, you can ask it again with info registers
<rwxr-xr-x>
okay, the logic here, the way i calc DATA_SEG, which is gdt_data - gdt_start, would be dd 0x0 - dw 0x0, which would bee the second segment in gdt_data
<rwxr-xr-x>
Yeah i get that, it just shouldn't need it to work
<zid>
it shouldn't need addition to work?
<rwxr-xr-x>
Why should the program need to be manually offset at a specific register
<zid>
because that's what the value in ds/cs/ss etc *means*
<rwxr-xr-x>
it feels like fixing an effect, not the cause
<zid>
the byte offset into this table to read segmentation information from
<zid>
the gdtr itself holds information about the table
<zid>
cs/ds/ss/etc hold an offset into the table
<zid>
invalid offsets do invalid things
<rwxr-xr-x>
huh
<zid>
lgdt [blah] load 12 bytes from memory for 'information about a table'
<zid>
err 6 bytes
<zid>
a 2 byte length, and a 4 byte address
<zid>
then cs/ds/ss holds an offset into that table
<zid>
that's 100% of everything
<zid>
That's why you loaded cs with 8, because the value in your GDTR says the table is at 0x7c40 and 0x7c48 has a thing that looks like a valid code segment descriptor
<zid>
cs is only a 16bit register, so if you put the full address into cs you'd have to keep all your selectors within the first 64kB of memory and that'd *suck*, so instead it just holds an offset into a table
<zid>
busy day today, got a patch into qemu to fix capstone, then patched capstone to not use AT&T
<zid>
and geist is only just waking up
<geist>
yah i shoulda got up a few hours ago
<heat>
zid, ew
rwxr-xr-x has quit [Read error: Connection reset by peer]
<heat>
AT&T 4LIFE
<zid>
Ah yes but
<zid>
“let there be light” is clearly destination-first, so this matter was already resolved by Genesis 1:3.
<geist>
also good job helping 755 there
<heat>
sky syntax when
<zid>
intel is sky daddy syntax
<zid>
at&t is.. demonic hellspawn syntax?
<zid>
yoda syntax
<zid>
I should make AT&T C, where the = operator is backwards
<mjg>
you, fuck
<geist>
note that zid's opinion is just that
<heat>
AT&T C comparison
<heat>
if (0 != number)
<zid>
movl 42, eax? more like 42 = eax; amirite
<heat>
that's so wrong
<geist>
but assembly isnot C. on that same token should we be upset there are no objects? or that tabs aren't important for nesting, or any other random language?
<heat>
movl $42, %eax
<mjg>
$42, movl, %eax
<mjg>
who is with me
<zid>
1f jmpl when
<geist>
left to right seems just as natural to me, it's just different. maintains brain plasticity
<heat>
$42 = %eax
<heat>
GNU assembler, but in C
<zid>
Oh so like BASIC
<mjg>
$eax %42 movl
<zid>
where you have to tag types with grammar
<zid>
%42 is integer 42, $42 is float 42.0 etc
<mjg>
and ^42.0 is bitcoin
<heat>
ftx moment
<heat>
weird fact someone just told me about
<zid>
"We've been hacked, also I am flying to argentina with this suitcase with $600M inside, don't ask why"
<heat>
XNU supports loading 4K aligned segments in arm64
<geist>
interestgig maybe that's used to load a corresponding aligned arm64 translated rosetta thing?
<geist>
i was generally under the impression that 4K is solely there to supoprt x86 stuff
<geist>
although i guess since you can make fat x86/arm64 binaries there may be more situations where it's necessary
<heat>
possibly, but this is just a macho loader hack
<heat>
it probably does away with any mmap CoW sharing but oh well
<geist>
yah possible
<geist>
i gues it worksin the way that hypthetically a completely unaliged ELF binary still works too, you just dont get any sharing, etc
<heat>
what do GNU toolchains align on?
<zid>
how are you supposed to say mach-o btw, mac-oh I assume, but.. if they're trying to pun macho that opens up two more
<heat>
geist, yeah, but traditionally operating systems just ENOEXEC because they can't bother
<geist>
yah
<geist>
mach-oh i am pretty sure
DoubleJ has joined #osdev
<heat>
geist, anyway what do the gnu toolchains (gnu, llvm) align on?
<heat>
given that the base page size varies
<geist>
i dont htink they align on anything that isn't described in the a linker script
<geist>
and there's a linker script for each arch, etc
<heat>
lld doesn't have a linker script
<geist>
oh you were asking about gnu toolchains
<heat>
gnu and llvm
<geist>
what lld does? beats me. probalby just has it hard coded per arch
<heat>
GNU-like
<geist>
it also supports less arches, so less to worry about
<heat>
i thought you'd know by just, you know, looking at stuff
<heat>
I'm specifically asking about ARM
<geist>
yeah but i dont really use lld
<heat>
64
<geist>
ah, well the ABI says you should align on 64k, so it probably does that
<geist>
unless you override it
<geist>
that's a case where there's a moern arch that has an ABI that says what you're supposed to do
<geist>
but of course the triple could override that
<heat>
heh
<geist>
but to be clear arm64 specifies a 64k alignment for segments (not sections per se) but segments (where the permissions change in the ELF binary) to allow you to load a single ELF file on a kernel running with 4, 16k, or 64k pages and still get COW, etc
<heat>
yeah
<geist>
so since there are generally at most 3 segments (RX, R, and RW) it's not *too* bad
<geist>
and depending on if you allow the pages in the bianry to overlap, it doesn't necessarily make the binary any bigger
<geist>
by default gcc/ld seems to allow overlapping, and clang/llvm doesn't (which pads out the binary a lot, usually by about 128k)
<geist>
the latter is more secure since it allows less gadgets (ie, ro/data pages mapped i the text segment with +x permissions)
<heat>
yeah
<heat>
tldr praise 4k
<heat>
the eternal page size
<geist>
i htink what we do for fuchsia is the non overlapped, but we override -mmax-page-size=4k
<geist>
which i think will bite us in the butt if we evere try for 16k pages, etc
* Ermine
screams in 16k
<Ermine>
Mac M1 uses 16k for some reason.
<geist>
yep. well more importantly apple ARM64 stuff uses 16k pages for years
<geist>
ie, iphone/ios, it's just now exposed to desktop users
<geist>
the 'for some reason' is it's probably much more efficient speed wise, at the expense of maybe using more memory
<geist>
it's a little hard to measure until you do it, but there are some hardware benefits to using less, larger pages
<geist>
especially on a system like M1 which iirc has a crapton of TLB entries, i think
<geist>
right off the bat it effectively expands the size of your TLB cache by 4x
<gog>
hi
<geist>
teh gog!
<gog>
is the tlb on arm different in that each one can indepedently track a page of varying size, because iirc on most amd64 they have fixed-size tags
<geist>
yes
<gog>
so there are only a handful of 1GB, more 2GB and then a bunch of 4k
<gog>
2MiB
<geist>
ARM has fully unified TLB, as well as most AMD machines. it's really intel x86 that has the split stuff
<gog>
ahhh ok
<geist>
i thought AMD only did that with zen, but someone at work pointed out that AMD has had a unified TLB since about K8 or K10
<geist>
clearly that's harder to implement in the TLB matching hardware, and probably adds a bit more gate delay in something that has to be hella fast, but its a case of a deeply optimized thing in either direction
GeDaMo has quit [Quit: I'm going to show these people something you don't want them to see. I'm going to show them a world without you.]
gareppa has quit [Quit: Leaving]
<mrvn>
On AMD64 the default pagesize is 2MB and that padds the binaries alot. But gcc seems to have it's own linker script and seems to do some magic depending on size or something.
<geist>
at some point he dfault max pagesize was 32KB which was strange and suited no one
<geist>
i dunno if that changed to 2MB at some point ,which actuallym akes sense
<mrvn>
geist: it's 2MB. You get hit with that on your kernels sometimes and your multiboot header ends up 2MB into the binary and doesn't work.
<mrvn>
You have to add the linker option for 4k page size to get the multiboot header into the first 8k sometimes.
<mrvn>
As for the TLB matching hardware: it turns the address compare from a 2-way AND + 56-way AND into a 3-way AND + 56-way AND. Or 2/3-way NAND + 56-way OR. I'm not sure that makes a noticeable difference.
* geist
nods
<geist>
yeah, i think the L1 TLB matchers have to be done at least within a single cycle, so it's definitely critical path
<geist>
but i'm sure that's highly highly optimized (at the expense of space)
<mrvn>
Having a 56bit compare hardware for every TLB entry must be huge in gate counts.
<geist>
yah
<geist>
well, it'sd not full 56 bit, but it's still a lot of bits
<mrvn>
well, less for CPUs that don't have 64bit virtual address space
<geist>
right
<geist>
so it's something more like 48 - 12 bits, but still 36 bits is a lot
<mrvn>
48 bits virtual, 12 bit at least for page leaving 36bit to compare here.
<geist>
but it also has to mux the matching logic based on the page size being tested for + the extra test to see if the TLB matches it
<geist>
largest i know of personally would be itanium which would be 64 - 3 (3 top level regions, presumably tagged differently) - 12 bits for page size
<geist>
er 8 top level regions, each with their own ASID
<geist>
of course, with ASIDS and PCIDs that's another parallel compare that's also happenining
<geist>
that must be anded in at the end
<geist>
but doesn't really make it deeper here
<mrvn>
hmm, not sure. Can't you have the same address in the TLB for different PCIDs?
<geist>
absolutely
<geist>
sio you have to in addition to all this address matching also match the PCID/ASID
<mrvn>
Then you have to AND that in earlier or you get 2 hits before you mask out one.
<geist>
possibly, yeah
<mrvn>
So back to 48 - 57 bits to compare.
<geist>
i honestly dont know what the state of the hard fast test for equality of a bunch of bits looks like, but i assume for somethingl ike there's there are gate level tricks for it
<mrvn>
You might safe some bits because the way TLB slots are assigned to addresses.#
<geist>
so that it's not just a chain of gates
<mrvn>
I would probably XOR the address and TLB address with a bus driver output. I.e. only output something when the bits don't match, then connect all the bits to a common line and negate that.
<mrvn>
+ a pull down
* geist
nods
<mrvn>
Should give you a 3 gate depth regardless of the number of bits.
<mrvn>
The TLB entry size then just enables/disables some of the bus drivers so the lower bits get ignored depending on size.
<geist>
yah, i think that's probably totally possible in an ASIC but not sure you can do that in an FPGA
<mrvn>
You connect the MASK as input to the bus drivers and the address XOR to the enable.
<geist>
FPGAs tend to be somewhat stricter about everything is a gate or a mux and you dont have any of these shared line things, but then that's just a different technology
epony has quit [Ping timeout: 268 seconds]
<mrvn>
a shared line is just etching a channel connecting all the outputs. Shouldn't be that hard.
<geist>
i think with an FPGA you probably at best end up with a bunch of 6:1 muxes with a truth table chained together
<geist>
so you get a tree but with a fan out of 6:1
<geist>
so only a few levels for a large test like that
<geist>
s/muxes/rom
<mrvn>
Oh, you mean when you implement that with FPGA logic units. That's way harder than a dedicated address compare circuit.
<geist>
yah
<mrvn>
They should have buses though.
<mrvn>
You might have to loop a bus output back to an input of the chips or something.
<geist>
not that i know of.i dont think you can really express any sort of open drain or floating things in fpgas at all
<geist>
without emulating them
<mrvn>
not in the normal LUTs, no.
<mrvn>
No floating in the truth tables.
<geist>
and i assume the connection of a LUT to a bus is basically hard coded, ie part of the bitfile you feed into it
<geist>
and not dynamically configurable as another latch
Burgundy has quit [Ping timeout: 256 seconds]
bgs has quit [Remote host closed the connection]
vdamewood has quit [Ping timeout: 260 seconds]
epony has joined #osdev
Burgundy has joined #osdev
rwxr-xr-x has joined #osdev
<rwxr-xr-x>
You still here zid?
xenos1984 has quit [Read error: Connection reset by peer]
<gog>
hi
<rwxr-xr-x>
hey gog!
<gog>
i'm still here rwxr-xr-x
<rwxr-xr-x>
how's it going?
<gog>
can i call you 755
<rwxr-xr-x>
yeah LOL
<gog>
:D
<rwxr-xr-x>
that's smart!
<rwxr-xr-x>
I didn't think of that
<gog>
<- smort gorl
gorgonical has joined #osdev
<gorgonical>
Conference speaking never gets easy
<gorgonical>
So frightening
<gog>
how do you feel about karaoke while sober
<gorgonical>
Also horrifying
<rwxr-xr-x>
its the perfect crime
<rwxr-xr-x>
sing your best, and if they hate it, say you were drunk!
<gorgonical>
Even like booth karaoke is frightening when sober
<gog>
i did 3 songs a few weeks ago
<gog>
and i only had one beer
<rwxr-xr-x>
shit
<rwxr-xr-x>
wow
<rwxr-xr-x>
i would fucking DIE
<gorgonical>
Cost like 400 isk, that beer I bet
<gog>
1200
<gorgonical>
I forgot the exchange rate
<gog>
inflation is bad here
<gorgonical>
That's pretty bad. That's like airport prices
<gog>
yeh
<gog>
that was just the beginning of the night tho
<gorgonical>
I mean when I was there it was expensive, too but I was even at the tourist bars and it wasn't that bad
elastic_dog has quit [Ping timeout: 240 seconds]
<gog>
yeh
elastic_dog has joined #osdev
<gorgonical>
do locals ever go to that lebowski bar, gog
<gog>
yeh me and my work friends go there sometimes
<gog>
i always get the brant
<zid>
That sounds like a euphamism
<gorgonical>
That's somewhat surprising to me. I always thought it was for tourists. I guess reykjavik's not big enough to be picky huh
<zid>
You do a rotation of the 4 businesses
<zid>
5th day you worship moss, then you repeat
<gog>
nah lebo is just cheap
<gog>
compared to a lot of burger joints
<gog>
zid: i'm an alichenist
<gog>
sorry
<gorgonical>
I went to aktu-taktu for the novelty and that was outrageous
<zid>
You must get bored every 5th day then
<gog>
i've never been to aktu-taktu
<gog>
or metro
<zid>
gog: How much is a tree on the black market there?
<gog>
hah
<gog>
it's easier to get a nuke
<gorgonical>
i think i got a cheeseburger with fries and a drink and it was nearly $20 usd
<zid>
so like, half london prices
<zid>
not bad for a capital
<\Test_User>
could I trade ya a tree for a nuke? :P
<gorgonical>
zid: how much does mcdonald's cost there??
<gog>
yeah $20 is about what you'd pay at a more upscale place
<zid>
about 40 grand in parking
<gog>
burger, fries and beer at lebo is about $18
<mrvn>
It's 3 EUR for a Döner on Mondays here.
<rwxr-xr-x>
okay, now that i'm back, let me jump back into this shithole code
<zid>
oh hey it back
<rwxr-xr-x>
yup
<rwxr-xr-x>
okay, the last thing i rushed in was mov bx, 0x10
<rwxr-xr-x>
mov ds, bx
<zid>
(seriously, parking in london is like $15)
<rwxr-xr-x>
can't remember why lol
<rwxr-xr-x>
wait what?
<zid>
because you got mad at ax
xenos1984 has joined #osdev
<rwxr-xr-x>
i recall nothing
<mrvn>
rwxr-xr-x: is that loading the value 0x10 or the memory at 0x10? What asm syntax?
<rwxr-xr-x>
Oh shit
<rwxr-xr-x>
that's true
<rwxr-xr-x>
let me check
<mrvn>
what's in bx when you single step it?
<mrvn>
i hate mondays
puck has quit [Excess Flood]
puck has joined #osdev
gorgonical has quit [Ping timeout: 256 seconds]
<gog>
i like mondays
<gog>
thursdays are what's hard
<rwxr-xr-x>
its sunday rn i don't know what y'all are on
<zid>
mondays is when bookworm comes out, it's the best day
<gog>
it's monday in an hour for me
<zid>
58 minutes to go, by so solid crew
<rwxr-xr-x>
mrvn how can I single step in qemu?
<zid>
you can't
<zid>
gdb can, but I wouldn't try it in 16bit mode, but.. technically you're past that so you could
<zid>
did you remember to switch your nasm to bits 32 after your long jump yet?
<zid>
you were mis-assembling before
<rwxr-xr-x>
wdym??
<zid>
your cpu has gone from 16bit instructions
<zid>
to 32bit instructions
<zid>
but you apparently never told your assembler that it happened
<zid>
so when you write 'mov ax, ...' the cpu sees 'mov eax, ...'
<rwxr-xr-x>
every time i make a long jump i use [bits 32]
<zid>
the binary you sent me was fucky and hadn't done that properly in the right spot, at least
<rwxr-xr-x>
what if I make a repo and stick all the relevant files and send it
<rwxr-xr-x>
would get rid of it
<zid>
You had B8 0F 00 8E D8 which was supposed to be "mov ax, 0xF; mov ds, ax" but that's 16bit, in 32bit that reads as 'mov eax, 0xde8e000f'
<zid>
And I am assuming you wrote mov ax, 0xf; mov ds, ax; and not infact, mov eax, 0xde8e00f
<zid>
how are you ensuring the right part ends up at 0x7C00 when you link this?
<rwxr-xr-x>
what do you mean?
<zid>
you want the first instruction first in your binary
<rwxr-xr-x>
well yeah
<rwxr-xr-x>
that's how first works
<zid>
so then the question
<zid>
how are you ensuring the right part ends up at 0x7C00 when you link this?
<rwxr-xr-x>
At the beginning of the main file, boot.asm, i use [org 0x7c00]
<rwxr-xr-x>
offsets everything by 0x7c00
<zid>
no it doesn't
<zid>
It tells that file that instructions referencing labels should add 0x7C00
<zid>
it does nothing to cause certain files' contents to appear in a certain order in the output
<rwxr-xr-x>
okay, i haven't looked at anything you've just said, i just have to say this
<rwxr-xr-x>
i just looked up 'org asm' in google on accident LOL
<zid>
That seems to be a running theme
<rwxr-xr-x>
org assembly
<rwxr-xr-x>
shit man
<rwxr-xr-x>
so org adds 0x7c00 to any labels in boot.asm
<rwxr-xr-x>
nowhere else
<\Test_User>
yes
<zid>
nor does it guarentee any kind of ordering
<rwxr-xr-x>
which is what i need rn
<\Test_User>
you need to tell the linker where to put the different sections in the final file
<\Test_User>
(unless you're not using a linker and just assembling straight to a binary, then it's different)
<zid>
I think he is but idk how he does that
<zid>
I asked
<zid>
but he didn't even understand the question :D
<rwxr-xr-x>
2 commands
<rwxr-xr-x>
nasm -fbin noot.asm -o test,bin
<\Test_User>
so no linker
<rwxr-xr-x>
qemu -fda test.bin -no-shutdown -no-reboot -d int -monitor stdio
<rwxr-xr-x>
nope
<zid>
okay so all thje other files in here are red herrings
<zid>
and the only one that matters is pingu.asm
<\Test_User>
you can specify a start=<x> in sections, or if using only one section it'll always be at 0 already
<\Test_User>
one/none
<klange>
pro type: `-serial mon:stdio`, multiplex serial and monitor on the same tty, switch with `ctrl+a c`
<klange>
protip
<klange>
even
<klange>
need caffeine
<zid>
crap was it AA 55 or 55 AA I can never remember
<\Test_User>
if qemu boots it that's right
<zid>
haha
<\Test_User>
I think it's 55AA in the final file and AA55 in dw bc little endian
<klange>
55 aa
<klange>
bah, do it with two bytes so you won't be confused
<rwxr-xr-x>
dw 0xaa55
<zid>
oh I see, it's copy pasting shit with %include
<rwxr-xr-x>
little endian confused the shit out of me at first because of the magic word lol
<rwxr-xr-x>
i was like why the hell did it get reversed????
<zid>
I'm getting close to getting this building properly, lots of globals and externs to add, I started while I waited for an answer and almost finished, so I thought fuck it might as well carry on
<zid>
will serve as an example later
<rwxr-xr-x>
what question are youwaiting on?
<zid>
I'm not anymore
<rwxr-xr-x>
im multitasking here, ive lost about 4 questions to noise
<rwxr-xr-x>
got it
<zid>
fuu just dleted a file I wanted to keep
<zid>
bitten for the billionth time that objcopy doesn't need -o also
<rwxr-xr-x>
man i fuckin hate 32 protected mode
<rwxr-xr-x>
shit is so confusing
<\Test_User>
wait till ya get to 64-bit mode
<rwxr-xr-x>
oh christ
<rwxr-xr-x>
i should really learn assembly more
<zid>
64bit is easier
<\Test_User>
but when confused at this level
<\Test_User>
sure once you're started 64-bit isn't really hard to deal with
<zid>
test.bin: DOS/MBR boot sector
<zid>
seems to have worked at least
<heat>
operating system
<zid>
oh hey it prints 'Started in 16-bnit real mode' too, good enough for me
<rwxr-xr-x>
thats what it should do
<rwxr-xr-x>
only half of it
<rwxr-xr-x>
yo what the FUCK
<rwxr-xr-x>
i downloaded the code off the github os-tutorial i was following and it works