<kazinsal>
I think I need to open it up and jam the SCSI2SD into a different slot though. I tried one of the front slots and it's not displayed in show dev
<geist>
ah yeah i took it apart and generally rigged it up. mine came without any drives and one of the bays was open
<kazinsal>
ha, same. we might have bought from the same guy
<mrvn>
Is that the BIOS?
<kazinsal>
yep
<mrvn>
Way more memory than my first Amiga had.
<mrvn>
That's like a HUGE server.
<mrvn>
Have you written a program that prints a mandelbrot fractal in ascii yet?
<kazinsal>
ha, I haven't even gotten this thing to boot anything yet
<kazinsal>
I'm just glad it's passing POST
Burgundy has quit [Ping timeout: 256 seconds]
kingoffrance has joined #osdev
<geist>
yah i forget if there's a more complete test it can run
pretty_dumm_guy has joined #osdev
<geist>
imma gonna go take a walk for a bit but when i get back i'll fire mine up and see what i can see
vdamewood has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kazinsal>
cool, thanks. poking at my SCSI2SD config to see if I've messed something up there. gotta figure out how to pop this thing open though, if it's a case of "plugged into the wrong connector on the SCSI chain"
<kazinsal>
it's been an awful long time since I've messed with SCSI and I forget some of the requirements of termination and stuff
<geist>
yah or it's not terminated or whatnot
<geist>
does yours have a tape drive?
<kazinsal>
nope. no drives whatsoever.
<geist>
and/or does it find the tape drive in show devices?
<geist>
ah
<geist>
iirc i think there are two scsi busses on it, but i forget how the tape drive was connected
<zid>
do I need to send you a big bag of pin jumpers
<zid>
I assume old hardware like that doesn't boot unless you draw the right modern art in jumpers
<mrvn>
kazinsal: the scsi cable needs a terminator at both ends and nowhere else. Sometimes the controler terminates and then you can only plug the end of the cable into the controller. Drives might or might not have a jumper.
masoudd has quit [Ping timeout: 240 seconds]
<kazinsal>
I think the issue is that the easily-accessible SCSI connections on the thing are 3 and 4 on the bus, and I need to plug into 1...
<kazinsal>
so yeah, gonna need to open it up
<zid>
do the devices need to know where they are, in scsi?
<kazinsal>
the good news is my 10BASE-T AUI transceiver works!
<zid>
IDE they did
<mrvn>
C has too many rules: struct A { int i; char c; short d[]; }; must be 8 bytes large because it can not be shorter than struct B { int i; char c; };
<mrvn>
struct B must be 8 bytes because sizeof(B) is the distance the objects have in an array where they must be aligned.
<mrvn>
zid: every device has an ID (0-7, 0-15 for wide scsi). Where doesn't matter but id must be unique.
<clever>
and the id is set with a jumper?
<mrvn>
zid: IDE has a master and slave line and iirc the two switch places for the second connector.
<mrvn>
clever: jumper with enclosures you can have a cable that moves it to the front/back of the enclosure so you can change it without opening.
<clever>
yeah
<mrvn>
s/jumper/jumper./
<kingoffrance>
i think i had a scsi scanner and it was just a little thing you rotate, maybe with a flathead screwdriver
<clever>
i once saw a usb scsi scanner
<kingoffrance>
i mean i had a scsi scanner, i dont remember that though. explain :)
<clever>
linux claimed it was a device like sda
<mrvn>
My scsi enclosure had a wheel with 0-7 on it and up/down buttons.
<mrvn>
clever: in linux everything is sda
<clever>
mrvn: but this scanner was actual scsi i believe
<clever>
behind a usb to scsi adapter
<mrvn>
*s*da. The S stands for scsi.
<clever>
dont ask me why
<mrvn>
The sata driver have adapted the scsi layer in linux in place of the ata layer.
<clever>
yeah
<kingoffrance>
scuzzy, noone say ess cee ess eye please
<mrvn>
code quality / flexibility.
<clever>
kingoffrance: i grew up watching reboot, i know how to say it :P
<geist>
i piddled arund with various versions. i think i found netbsd 5 or 6 was pretty solid, but it starts getting progressively slower
<kazinsal>
that's how far I got
eddof13 has joined #osdev
<geist>
but this gives you a good opportunity to start decoding what that means!
<geist>
iirc the 512MB at 0x8000.0000 to uh 0xa000.0000 is an identity map of physical ram. i think. or maybe it's somewhere else
<geist>
so i think that's basically physical address 0x00169984
<geist>
iirc the hardware b asically has multiple hard coded zones of ram. something like 0-2GB is user space, always paged. 512MB at 0x8000.0000 is physical ram, kernels frequently run there
<geist>
and then there are 3 more 512MB zones, some of which are paged and some of which are device memory. i think
<geist>
so the 'physmap' is essentially hard coded
<geist>
iirc SH-4 has something extremely similar, and i think i had read that some MIPS cpus do that too. it's their way of working around the TLB missed based arch (you put the TLB miss handler in the phsyical map so no TLB is used to translate the handler)
<geist>
otoh means VAX has no meltdown: user space code simply cannot translate >2GB. it's forbidden
<geist>
but the S0 being supervisor only is still true, iirc
<geist>
and i guess i gotta be more specific too, since 'supervisor mode' in vax is just one of the 4 rings, and not the highest priority :)
<kazinsal>
yeah, the architecture is fascinating
<geist>
but i do remembwer tat the P0, P1, S0 regions each have their own page table
<geist>
VAX does not have a heirarchial page table, each of those zones has a page table pointer + length
<geist>
so P0 grows upwards, P1 grows downwards
<geist>
and S0 grows upwards. so you kinda have to pick up front how much space you want to allocate to your kernel (S0) because it occupies a run of physical space
<geist>
but.. the fun thing is the P0/P1 page table arrays live in S0 space, so it kinda is a recursive page table
<geist>
ie, you can allocate a virtual, zero fill on demand page table for user space
<geist>
also a thing itanium has, albeit much more complicated
<geist>
that was the next thing i was going to implement on LK. i should dust off that code and get it merged in
<geist>
the thing i think was holding me back was the lack of good atomic support, so i was going to need to find a way to emulate most of the modern atomic routines
<geist>
since vax only really has swap and the linked list insert/remove stuff
<geist>
so for non SMP the solution is almost certainly to just disable ints and do the work
<kazinsal>
hoo boy netbsd's archive mirror is slow. a brisk 115 KB/s
Scripted has quit [Ping timeout: 256 seconds]
<geist>
i gotta admit i'm dissapoint: you should start with VMS
<kazinsal>
ha! I should, honestly
<kazinsal>
I think VMS 7 will run on these
<geist>
absoltely. 7.3 was the last, and you can find the iso
<geist>
actually runs really nicely
elastic_dog has quit [Ping timeout: 240 seconds]
<geist>
feels like it runs quickly, whereas you'l find that netbsd is... not super fast
elastic_dog has joined #osdev
<zid>
what about slowlaris
srjek has quit [Ping timeout: 240 seconds]
<kazinsal>
ultrix could be fun to run on it
<geist>
zid: there was no port of solaris to vax
<geist>
hmm, yeah i wonder if ultrix media can be found
gog has quit [Quit: byee]
<zid>
that's surprising
<kazinsal>
Sun didn't really like the idea of people running their unix on non-Sun machines
<kazinsal>
and by the late 80s Sun was pretty gung-ho on the RISC train
<geist>
only very recently
<zid>
ah so it's kazinsal's job
<geist>
as in last 10-15 years. after vax was thouroughly obsolete
<zid>
yea but it seems precisely the sort of thing that would have happened 40 years later
<geist>
even these microvaxen we have is basically a very late model fairly obsolete thing
<zid>
like running doom on things that were not made to run doom
<geist>
i think these were made in the early 90s, after DEC was already transitioning to risc
<kazinsal>
yep, this one was manufactured in May 1992
<geist>
i think alpha came out about then
gog has joined #osdev
<geist>
and they had been making some MIPS based things
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
nyah has quit [Ping timeout: 240 seconds]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<kazinsal>
nice, got the OpenVMS installation CD booted. now to read the manual because I have never touched a VMS before
<geist>
oh no, it has begun: like clockwork my logitech gamer mouse will last about a year and a half
<geist>
and then start to fail at either button presses, or roller wheel
<zid>
double clicking?
<geist>
this time it's not double clicking, but down on the wheel
<geist>
starts to miss
<kazinsal>
funny, my corsair gamer mice do the same thing like clockwork
<geist>
yep
<kazinsal>
first, needing way more force than usual for middle click
<kazinsal>
then needing more force than usual for left click
<geist>
then i get upset, swtich to some cheapass $5 mouse fo about a month before i grudgingly buy a new one
Jari-- has joined #osdev
<zid>
I wish someone would just sell a mouse that used a decent voltage on the switches and had proper debouncing
<kazinsal>
yeah I started lose middle click in the middle of a game of League and pulled out my old work mouse and got frustrated enough within 15 minutes that I just went back to the busted mouse
<kazinsal>
oh god right VMS has friggin license PAKs
<geist>
yah i thou7ght the basics would work though
<geist>
i actually had a real hobbyist license, but HP finally stopped handing them out in 2020
<kazinsal>
yeah they should
<geist>
a sad day
<geist>
also sadly they're time based, so you had to renew every year (or keep setting the clock back)
<zid>
OPENVMS NO-CD ULTIMATE EDITION.rar
<geist>
seems that hypothetically there mayyyy exist methods to crack the PAK license. perhaps. not that i'd know
<zid>
Hypothetically.
<geist>
hmm, mine isn't finding the scsi2sd that i left in
<geist>
guess i gotta pop it out
ElectronApps has joined #osdev
<kazinsal>
heh, firmware had a bit of a brain fart. VMS installer rebooted the machine... and it started trying to boot from DECnet
<geist>
hmm yeah looks like the scsi2sd is just not coming up. i thought it had at least an LED no it
<geist>
but i checked and the power connector is alive, and the tape drive on the same bus is scanned
<geist>
yeah this is strange. the scsi2sd looks fine
<geist>
but suddenly the thing wont talkt o it
<kazinsal>
that's bizarre
rustyy has quit [Quit: leaving]
rustyy has joined #osdev
<Jari-->
geist, what is the URL to your OS home page?
<Jari-->
also others could provide me web content, like screenshots for your OSes
<geist>
CompanionCube: yep. they only seem to have taken on non vaxe versions
<geist>
i thin it's not so much that they're not allowed, as in they dont want to
<geist>
they only i think took ownership of the other arches
ravan has joined #osdev
<geist>
my personal guess there is it's because the original vax VMS was written in assembly, but it's my understanding that newer versions were written in some higher level language
<geist>
so they *probably* just reimplemented it for alpha and above
<geist>
and possibly never converted the vax version
<geist>
so in addition to it being an obsolete architecture, i dont think anyone wants to maintain it
<CompanionCube>
would make sense, they didn't particular want the arch so they don't get the rights to license it
<kazinsal>
oh dear god I forgot to uncheck the option to install X11 auuuugh this is going to be installing all night
<geist>
oh no!
<CompanionCube>
decwindows or netbsd x11?
<kazinsal>
netbsd x11
<CompanionCube>
unrelated: vms has cool clustering support
<CompanionCube>
the highest uptimes for those were in decades, i think
<mxshift>
used a VMS cluster spanning a VAX and an Alpha. That was....interesting
<kazinsal>
grbl. needing to open up the VAX to make changes to my SCSI2SD or to change the ISO on it going to drive me nuts... considering fabricobbling together a front bay plate with one of these in it: https://www.adafruit.com/product/3687
<bslsk05>
www.adafruit.com: SD Card Extender [68cm (26 inch) long cable] : ID 3687 : $6.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Electron has joined #osdev
ElectronApps has quit [Ping timeout: 250 seconds]
<kazinsal>
blowfish password hashing on a microvax: bad idea
Burgundy has joined #osdev
<zid>
Agreed, you clearly need a cluster of them first.
<CompanionCube>
herd of VAXen!
xenos1984 has quit [Remote host closed the connection]
xenos1984 has joined #osdev
<kazinsal>
ooh, maybe turning sshd on on this machine was a bad idea... it's been generating keypairs for ten minutes now
dormito has quit [Ping timeout: 252 seconds]
<kazinsal>
oh yeah. this was a mistake.
[itchyjunk] has quit [Read error: Connection reset by peer]
Matt|home has joined #osdev
mlombard_ has joined #osdev
mlombard_ is now known as mlombard
<zid>
I bet it's actually hard to even ssh into an old machine these days with either the modern client refusing to speak old weak protos
<zid>
or the server being too slow to do 8192 bit nicely
mahmutov has joined #osdev
ThinkT510 has quit [Quit: WeeChat 3.4]
ThinkT510 has joined #osdev
<kazinsal>
yeah, I occasionally have to ssh into some old cisco boxes that only speak dh1-sha1
Jari-- has quit [Ping timeout: 256 seconds]
Jari-- has joined #osdev
mahmutov has quit [Ping timeout: 252 seconds]
C-Man has quit [Ping timeout: 260 seconds]
<j`ey>
kazinsal: hows the install progress?
<kazinsal>
I have a working NetBSD/vax machine on my network
Jari-- has quit [Remote host closed the connection]
<j`ey>
>:D
GeDaMo has joined #osdev
Electron has quit [Remote host closed the connection]
ElectronApps has joined #osdev
<zid>
I think I'm going to localize C into spanish
<zid>
All operators must be ended with an upside down copy of the same operator
<mrvn>
Turning that into SSA I would get: x<INVALID>; x<1> = x<INVALID>
<j`ey>
warnings usually happen with the AST though, not at the SSA level
<mrvn>
Maybe the code get eliminated before it gets to ssa
<mrvn>
volatile int x = x; warning: 'x' is used uninitialized
<mrvn>
That seems both right and wrong at the same time.
<GeDaMo>
If you're writing x = x that's probably a mistake :P
<mrvn>
What are the rules there in C? Is that the same as "volatile int x; x = x;" or does C have some initialization optimization there like c++?
<mrvn>
GeDaMo: perfectly valid with volatile. e.g. echo everything on the UART.
<mrvn>
*UART_DR = *UART_DR;
<zid>
overloaded = with an x that has side-effects when evaluated, ez
<Scripted>
Guys I still get an invalid magic number panic when I try to get the memory map from the multiboot bootloader. https://pastebin.com/wHNRkM4E
<zid>
anyway, without being able to actually reason about this cus.. I can't build it or convince you to use a debugger, did you check the order of the args you pushed and which register is which etc?
<zid>
or read the source
<Scripted>
No, but I can use a debugger
<Scripted>
well reading my source code is something I would have done in first place
<mrvn>
reading your own source code is far harder than you think.
<mrvn>
too much seeing what you thing you wrote
<mrvn>
think even
<junon>
I feel like I'm missing something dumb. This halt stub doesn't work - just causes a triple fault. Is there anything immediately, obviously wrong with it?
<junon>
I'm thinking maybe I need to specify that it's amd64? Could clang somehow think it's x86 or something?
<junon>
Idk I need to attach to qemu (need to figure out how to get qemu to boot the debug server immediately instead of relying on the REPL)
<zid>
"ax" flags ont he section because your linker is doing funny things with permissions on the page?
<mrvn>
junon: qemu -d ...
<mrvn>
also: file asm.o to see what it is
<j`ey>
junon: -S -s starts the server and waits to be started by gdb
<junon>
thank you all
<junon>
but alas, it was something dumb
<junon>
.section text
<zid>
that'd do it
<zid>
I think my suggestion of adding "ax" might have fixed it anyway if your loader did the right thing :P
<junon>
thanks for the qemu flags, though, those are useful. How do you get -d to work if the guest is manhandling the TTY? can I tell qemu to not show guest output somehow?
<junon>
zid: what does "ax" mean here?
<mrvn>
If the linker script has: .text { text } that should work too
<zid>
allocate, executable
<junon>
I'm surprised that the linker didn't bark about code being a part of unused sections
<zid>
do you have a /DISCARD/ rule?
<junon>
Is there a way to get ld to whine about that, perhaps?
<junon>
Nope
<Scripted>
so I have figured out that the value of my magic number is in reality 38144 which is not correct
<zid>
how does it know it's unused anyway
<zid>
it should end up in the final image after all the things you specified, by default
<mrvn>
junon: you didn't flag it to be kept and nothing refers to it
<j`ey>
junon: and so does linux
<junon>
Yeah makes sense now
<zid>
On most modern targets, the linker attempts to place orphan sections after sections of the same attribute, such as code vs data, loadable vs non-loadable, etc. If no sections with matching attributes are found, or your target lacks this support, the orphan section is placed at the end of the file.
<zid>
if you made it "ax" it might have glommed into .text automagically, or at least ended up at the end of the image, and still been loaded into memory, with the right permissions :P
<junon>
Ahhh okay
<junon>
So j`ey then if you're using e.g. --orphan-handling=error for example, do you just manually place/discard all of the sections that it lists in your linker script?
<junon>
There are a lot here for a debug build it seems. Trying to figure out the best way to go about this so that I can't make this same mistake again lol
<j`ey>
junon: yes
<junon>
also zid: you're referring to the PHDRS `FLAGS()` values right?
<junon>
text is `FLAGS((1 << 0) | (1 << 2))` at the moment
<junon>
I don't know what allocate means here, though.
<zid>
loaded into memory, effectively
<zid>
rather than something like .debug which is not
<bslsk05>
github.com: stivale/STIVALE2.md at master · stivale/stivale · GitHub
<junon>
bootloader protocol
<zid>
oh, burn it with fire then
<junon>
why
<zid>
it has bootloader in the name
<mrvn>
So they tried to make a better protocol with stivale and failed. Now they try again with V2 because they messed up so bad they couldn't even fix the first one. Should I use this?
<zid>
fun fact, for the nintendo switch, every single department wrote their own bootloader so they could test their code on hardware :D
<mrvn>
zid: lol
<mrvn>
'stivale2 natively supports (only for 64-bit ELF kernels) and encourages higher half kernels.' Sorry, that's unacceptable.
* junon
shrugs
<junon>
works well enough for now.
<zid>
I wrote my own 64bit elf loader cus.. x86 is pretty dire when it comes to 64bit support in loaders :(
<junon>
I can replace it later. Right now I want to focus on the more design-specific things. Not having to construct my own memory maps to start helps early on. I can do that later.
<mrvn>
junon: but on x86 I still have to do that.
<zid>
It *is* a kind of annoying problem though because you need paging to be enabled, so it's *really* hard to allocate memory if you're just given a .text
gorgonic- has joined #osdev
<zid>
so my bootloader maps a bunch of ram and passes it as a param, so I guess I have a bootloader proto
gorgonical has quit [Ping timeout: 256 seconds]
<mrvn>
zid: does it bring up other cores?
<junon>
mrvn I'm targeting x64 to begin with.
<zid>
ooh itanium is my favourite
<junon>
x86_64* sorry
<zid>
(it's not I just love to joke that every name also means itanium depending on which document you look at)
heat has joined #osdev
<mrvn>
junon: To me it just shows bad design choices. Like they started and said "we aren't going to do your virtual memory for you". Then they hit x86_64 and saw they can't go to 64bit mode without the MMU on and added a special case for that only for 64bit.
<heat>
upwards cat
<zid>
heat doing yoga
<heat>
:D
<mrvn>
junon: oh it gets worse. stivale can load elf or anchored. So I take my perfectly working elf kernel and turn the elf file into an anchored file and suddenly your memory mapping is gone.
<junon>
Yes I saw that
<junon>
I'm using it as a jumping off point, nothing more
<heat>
i think stivale 2 and limine are like part of a new wave of bootloaders that noobs frequently use
<junon>
I intend to replace it if/when it ever gets to that point
[itchyjunk] has joined #osdev
<mrvn>
WTF? They have the code. They have the bit that says do PMR and then they say: Nah, not today.
<heat>
I don't know why tbh, is it because of the osdev discord?
<j`ey>
yes
<zid>
I got banned for suggesting people don't write bootloaders :D
<zid>
(That and I deliberately told it to the really ban happy guy and told him he was wrong)
<mrvn>
zid: lets write a bootloader to fix all bootloaders
<heat>
yes, let's write a bootloader to fix all the bootloaderes
<junon>
call it the "majestic united bootloader"
<heat>
call it
<zid>
ooh good idea heat
<mrvn>
uint64_t flags; // All bits are undefined and must be 0. lol
<heat>
Unified Extended Firmware Interface
<heat>
it will be extensible
toulene has quit [Ping timeout: 272 seconds]
<zid>
sorry not my style
<mrvn>
Yet Another BOOT loader?
<zid>
I want the BASIC JANK from the 80s, not some extensible firmware nonsense
<heat>
yo dawg I heard you hate UUIDs, so we call them GUIDs and stick them to everywhere we can
<mrvn>
stivale2 seems to do one thing right at least that zircon does to and I want to have as well: The kernel can provide an array or memory ranges (base, length, flags) that should get mapped. Half right I should say: Where is the "to_where" field?
toulene has joined #osdev
<mrvn>
3 strikes and your out. Sorry, stivale2
<heat>
i like simpler bootloaders that go beep boop
<mrvn>
heat: turn on DRAM, call start
<heat>
do platform initialisation and load a kernel without having a bootloader in the middle
<zid>
bootloaders for mmus are weird anyway cus they either invade high memory or have to leave a bounce page mapped
<heat>
if only my idea of a unified extended firmware interface existed :(
<zid>
disgusting either way
<mrvn>
zid: cpus really should have an opcode to switch page tables AND set PC
<mrvn>
and mode
<zid>
I wonder if
<zid>
you could do it via an IRQ somehow
<mrvn>
iretpg -- return from interrupt with new page table :)
<mrvn>
zid: how would an IRQ switch page tables?
<mrvn>
(which totally should be a thing too then)
<zid>
so like, something like where you used to not reload cs to not change gdt yet
<zid>
and you had to do a longjump
<zid>
set *up* paging and stuff, but don't actually invoke it until the cpu grabs the tss for the irq or whatever
<mrvn>
I think on x86 all of this would be a task gate
<zid>
crap yea I just described a task gate didn't I
<zid>
fuck
<mrvn>
removed in x86_64
<zid>
they were removed because they sucked
<zid>
not worth doubling up on the suck by trying to extend all the fields to 64bit :p
<mrvn>
because they sucked or because nobody used them and doing it by hand was faster?
wgrant has quit [Ping timeout: 256 seconds]
<zid>
both
<heat>
i think arm64 and riscv could probably do it speculatively if you don't put a barrier
heat has quit [Remote host closed the connection]
<zid>
laame I just restarted my browser and all my cookies are gone for some reason
bruce633 has joined #osdev
heat has joined #osdev
<zid>
time to do a billion password resets, cus like hell I remember
<junon>
? you don't use a password manager?
<zid>
no I just never bothered to get into the habit
<zid>
I've been not using one for 20 years, 21 can't hurt, 22 can't hurt, ...
<mrvn>
password managers are so last year, use a password mutator
<mrvn>
e.g. your password is foobar, always, but you hash it with the site to make a unique password for the site.
<bruce633>
os dev is great, thanks
mahmutov has joined #osdev
bruce633 has quit [Quit: Client closed]
<gog>
mrvn: iirc it was explained to me as basically that, few major vendors bothered with the hardware task switching and call gates so intel never bothered improving their performance and then they became even more unnecessary things
<gog>
linux did early on though
<gog>
but this was when the 386 was new
ElectronApps has quit [Remote host closed the connection]
<zid>
you'll grow out of it anyway I feel
<zid>
wanting to do your own impl that does more gooder stuff
<heat>
junon: I use chrome as a password manager ezpz
<heat>
also firefox
<zid>
turns out the web is only 3 websites reposting each other's content
<zid>
so I only had to remember 3 passwords
<heat>
lol
<heat>
the only gripe that I have with using a web browser as a password manager is that sometimes it has issues detecting you're creating an account/resetting your password so it doesn't give you the "generate strong password" option
bruce63332 has joined #osdev
wgrant has joined #osdev
bruce63332 has quit [Quit: Client closed]
kingoffrance has quit [Quit: Leaving]
orthoplex64 has joined #osdev
srjek has quit [Ping timeout: 240 seconds]
srjek has joined #osdev
bruce633 has joined #osdev
heat has quit [Remote host closed the connection]
heat has joined #osdev
wand has quit [Remote host closed the connection]
wand has joined #osdev
bruce633 has quit [Quit: Leaving]
freakazoid333 has joined #osdev
immibis_ has joined #osdev
immibis_ is now known as immibis
xenos1984 has quit [Remote host closed the connection]
xenos1984 has quit [Remote host closed the connection]
xenos1984 has joined #osdev
<mrvn>
In ocaml you have this for variant types: type t = .. type t += Bla of int | private Nickers of underwear type t += Foo of bar
mrvn has quit [Quit: leaving]
mrvn has joined #osdev
<mrvn>
re. Anyone else having problem with libera:6697 /tls)?
<GeDaMo>
Not that I know of
<mrvn>
18:01 [libera] -!- Irssi: Connection to irc.libera.chat established
<mrvn>
18:01 -!- Irssi: warning Connection reset by peer
<mrvn>
Great. Now I know exactly what is wrong. :(
<clever>
heat: ive sometimes had lastpass issues on sparkfun.com, where it would auto-fill the product search box, causing a popup of results that covers half the page
<Scripted>
hey, so I have managed to fix the issue with the magic number but somehow the magic number obtained with the original one is only the same if I use the itoa() function.
<bslsk05>
reviews.llvm.org: ⚙ D42154 Don't generate inline atomics for i386/i486
<geist>
llvm i kinda doubt it, gcc yep
<geist>
i think llvm doesn't really care for things that are obsolete in general
<heat>
"The LLVM backend currently assumes every CPU is Pentium-compatible."
<geist>
yah. possible you can get away with thigs, but it depends on what parts of the isa you need
<geist>
also stuff like i dunno if llvm has support for no fpu, because what x86 doesn't have a FPU? (pre pentium is the answer)
<heat>
kernel code
<geist>
right, so in that case you're probably fine, etc because you just avoid it
<heat>
compiler-rt has a bunch of soft float code I think
<geist>
it seems to be per arch and per compiler whether or not it'll happily emit long versions of floating point if you have the fpu enabled
<mrvn>
no soft-float for x86? Wouldn't that use generic soft-float code?
<geist>
arm32 for example has full support, but i think arm64 has no fallback soft float code on either llvm or gcc
<mrvn>
Or is all soft-float code asm?
<geist>
i think it depends
<geist>
and yeah probably lots of asm
<geist>
and/or ABI and/or anyone putting in the time to make it happen
<mrvn>
If it where me I would have implemented it in C. Then specialize per arch where I feel like it.
<heat>
I'm looking at compiler-rt right now
<heat>
there's a lot of soft float code in C
<geist>
so this may also be a thing you bump into when fiddling with arm64: if you set -mno-float (or whatever the switch is) and then expect the compiler to emit fallback code for you, it will not
<heat>
yeah it's all C
<mrvn>
First reason just so that you can run one against the other to verify stuff.
<geist>
i think itmay be ABI related: the ARM64 abi says args are passed in regs, but if you have no float you can't pass by regs
<geist>
whereas arm32 had a bunch of alternate 'pass by integer registers' ABIs defined
<heat>
geist, does the ABI not vary if its soft fp?
<mrvn>
geist: I think -mno-float should be ok with that. m-soft-float would pass floats in int regs.
<geist>
not on ARM64. they chose to simply not define it
<geist>
as in there's no standard ABI for soft fp because they have decided to say float is always there, period
<heat>
libgcc/compiler-rt does the soft fp by getting floats as ints
<mrvn>
So ARM64 simply has on/off. No soft-float.
<geist>
which is frankly wayyyyy etter than arm32
<geist>
right, you disable float on arm64 with -mgeneral-regs-only i believe, which is a hard stop
<heat>
one thing that really annoys me: once you disable the FPU stuff in the compiler, it refuses to see any floating point, period.
<geist>
arm32 has ELF file level ABI bits even that define precisely what FP arg passing mechanism it is using (to keep you from linking .o files with different styles)
<mrvn>
geist: You can probably make a Float/Double class that collapses to integer regs or fpu regs.
<heat>
this is an issue because if you start using freestanding C++ headers either gcc or clang start inlining basic stdlib floating point stuff in the headers and you're screwed
<geist>
sure, you can define your own software float lib if you want
<geist>
heat: yep. and this is one of the reasons we very carefully bring in only parts of std into zircon kernel
<Scripted>
guys, I finally did it
<geist>
for precisely this sort of reason (also generally things like containers that new/delete)
<Scripted>
it's here
<heat>
also, annoying stuff #2: riscv gcc/clang fights you if you try to use instructions you didn't explicitly enable
<bslsk05>
github.com: Onyx/fpu_state.S at master · heatd/Onyx · GitHub
<geist>
mrvn: yep, that's why we simply disallow that in the kernel. and we can catch it at link time by specifically hidig plain new/delete
<geist>
if the linker tries to find it it'll get an undefied link
<heat>
works in gcc and clang
<mrvn>
geist: I want that to work with allocators only.
<geist>
heat: ah good. mayb that's new
<mrvn>
So you can make a Slab and then run a container with new/delete in it.
<geist>
heat: it was a real pain in the ass
<geist>
mrvn: yeah we define an alternate set of new/deletes in zircon that explicitly return an error code via a pointer/reference arg
<geist>
a) it means the plain ones are undefined and get caught at liker time
<geist>
and b) it disables a 'news cant return null' optimization that modern compilers have
<geist>
which is really really frustrating
<Scripted>
mrvn: any idea why it's still the same result?
<heat>
geist: the news cant return null thing is an optimisation
<mrvn>
uint64_t magic
<heat>
uh what
<heat>
mindfuck
<mrvn>
multiboot_info_t* mbd
<heat>
the news cant return null thing can be disabled by a flag
<mrvn>
Both arguments to kmain are a lie.
<geist>
heat: yeah i know, but it's also frustrating in a situation where it might
<Scripted>
What do you mean?
<geist>
well, not really. the flag thing is bad
<heat>
geist, why?
<geist>
there is a flag that disables it, but it also disables a whole pile of other optimizations
<geist>
which are good
<heat>
i did not know that
<mrvn>
scripted: I believe multiboot gives you 2 uint32_t.
<heat>
do you just noexcept the operator new?
<geist>
unless that's changed in the last few years, we did a bunch of digging in the early days of zircon about it
<Scripted>
I copied those arguments off osdev
<mrvn>
heat: you just do and ignore out-of-memory.
<geist>
heat: no. that would be too easy. the c++ spec says basically that new shall never return null
<geist>
noexcept or except
<geist>
so any pointer returned from it the compiler tags as a nonnull variable
<mrvn>
Unfortunately you can not say "new may return nullptr instead of throw"
<geist>
so the switch disables the tracking of nullness of variables in the compiler
<geist>
which is helpful in lots of other places
<geist>
but what we found was any nonstandard operator new (just take an extra arg of your choosing) doesn't follow this rule
<geist>
so we have a little helper class that basically returns an error code if the allocation was successful or not
<geist>
that you pass a ref to
<geist>
and has some logic to force you to test it, etc
<geist>
should probably go back and revisit it now, probably more ergonomic ways to do it, but it is all over the codebase now (search for AllocHelper I believe)
<mrvn>
scripted: You are pushing eax and ebx on the stack to call kmain. So the second argument ist uint32_t.
<mrvn>
scripted: and on 64bit the first is uint32_t and not a pointer.
<mrvn>
(unless you extend them in the asm)
<Scripted>
mrvn: I'm on protected mode
<mrvn>
scripted: no idea what is still wrong. now you have to attach a debugger.
<Scripted>
: (
<mrvn>
scripted: and look at the objdump output.
<mrvn>
"uint64_t magic" is wrong but accidentally the top 32bit seem to be 0 so no harm.
<geist>
maybe it screws up the alignment?
<Scripted>
no idea
<mrvn>
geist: it prints the reight value with lltoa
* geist
nods
<mrvn>
can't see anything wrong in lltoa that would drop bits or anything.
<Scripted>
that code is stolen btw
<Scripted>
didn't have the energy to write my own lltoa
<mrvn>
You should learn to steal better code. What do you thing ito(-1) does?
<Scripted>
ito(-1)?!
<mrvn>
itoa(-1) or lltoa(-1)
<mrvn>
compare the two
<Scripted>
well, I think the compiler would complain
<Scripted>
because it requires 2 values
<Scripted>
but instead you just gave 1
<mrvn>
ups, + the base
<mrvn>
itoa() doesn't check the sign.
<Scripted>
so itoa(-1, -1) and lltoa(-1, -1)
<Scripted>
the one converts uint64_t and the other one converts int to char*
<mrvn>
A negative base or base 1 is totaly wrong and explodes too. But itoa(-1, 10) should work.
<mrvn>
Can one static_assert(base == 2 || base == 8 || base == 10 || base == 16); in C?
<Scripted>
I have no energy to concentrate anymore
<Scripted>
If I knew what static_assert did, I would tell you.
<geist>
generally recomend printing hex up front
<mrvn>
scripted: assert something at compile time
<geist>
since a hex converter is almost trivial compared
<mrvn>
In C++ I would make it so itoa() would refuse to compile with any other base than 2, 8, 10, 16
<Scripted>
because?
<mrvn>
You don't want that and it gives better code for known bases.
<GeDaMo>
What do you use this lltoa for anyway?
<Scripted>
for converting my magic number and the magic number of multiboot.h into char*
<Scripted>
so I can print them out and compare them
<Scripted>
there's one off-topic thing that really interests me
<mrvn>
pizza?
<Scripted>
No..
<Scripted>
Do you guys have some PhD in CS or how do you know all of this?
<mrvn>
yes, no, years of practice
<GeDaMo>
I read a lot
<Scripted>
yeah, but I mean
<Scripted>
that's fucking insane
<jimbzy>
Hang out here for a while and it will all become less fuzzy.
<jimbzy>
Never quite clear, but less fuzzy.
<mrvn>
You know in school you complain that you have to learn stuff just to learn it and will never ever use it in real life. That's what we do here too all the time and then one day we actually need it.
<Scripted>
as far as I know you can actually earn specizialize in osdev and earn a PhD for your research
<Scripted>
mrvn: this is actually pretty useful
<Scripted>
especially in cyber security
<mrvn>
You can specialize in anything you get a prof to guide you in.
<jimbzy>
mrvn, I am the exact opposite. I'm geeking out over it all and my peers are like "What's his problem?"
<mrvn>
OS Dev is an option in masters stuff too. Not just research.
<Scripted>
at least I hope this knowledge pays off in reverse engineering if I start actually willing to learn assembly properly
<mrvn>
scripted: you basically only need to read asm.
<Scripted>
mrvn: not only that
<Scripted>
that's just 1 part
<Scripted>
you might as well write something in assembly!
<mrvn>
scripted: When I need any complex asm I write C code, compile it and look at it. That solves 99.9% of needs.
<Scripted>
mrvn: that's called cheating
<jimbzy>
I learned a lot about assembly through reverse engineering.
<Scripted>
nono
<mrvn>
that's called saving you 2 hours of wasted work.
<Scripted>
mrvn: only real programmers code game engines in assembly
<Scripted>
bare assembly
<Scripted>
no C/++ functions allowed
<jimbzy>
Nah, that'd be Chris Sawyer.
<mrvn>
scripted: go and help out on templeos
<CompanionCube>
also you're gonna need C/C++ functions
<Scripted>
mrvn: I'm not that good in osdev yet
<Scripted>
actually I'm pretty incompetent in this area of programming
<CompanionCube>
what do you think your graphics API is written in. unless you do software rendering in asm? :)
<Scripted>
CompanionCube: you can write anything in assembly
<CompanionCube>
indeed, but you said no C/C++ functions allowed
<Scripted>
exactly, so?
<jimbzy>
Rust.
FatalNIX has quit [Quit: Lost terminal]
<Scripted>
at this point I get aggressive seeing people just using windows.. I don't know why..
<Scripted>
it's a curse
<jimbzy>
It works
<Scripted>
it works and what do you give?
<Scripted>
your freedom
<Scripted>
your PC
<Scripted>
your RAM
<Scripted>
your data
blei has joined #osdev
<CompanionCube>
scripted: so unless you do software rendering you do in fact need C/C++ libraries
<Scripted>
all of this could've been solved by just installing some ez distro
<Scripted>
CompanionCube: no problem, just port those libraries in assembly
<jimbzy>
I've been using Linux for 15 years now, but I still use Windows for stuff.
<Scripted>
jimbzy: that's where KVMs with pci passthrough come in
<CompanionCube>
porting opengl or vulkan into an assembly sounds very unfun.
<GeDaMo>
scripted: in your kmain you've compared to MULTIBOOT_HEADER_MAGIC but you're printing MULTIBOOT_BOOTLOADER_MAGIC
<Scripted>
CompanionCube: that's why you need the willpower to dedicate your entire life to code a game engine in asm.
<Scripted>
GeDaMo: LMAO, you see how tired I am
<Scripted>
GeDaMo: thank you a ton
<Scripted>
a ton
<Scripted>
really fucking ton
<Scripted>
this was the issue mrvn
<Scripted>
it works now
<Scripted>
oh my god
<Scripted>
god bless you
<GeDaMo>
:D
<heat>
btw templeos isn't written in assembly but HolyC
<Scripted>
heat: it's identical to assembly
<j`ey>
no?
<CompanionCube>
no it's not
<jimbzy>
Every time I think of HolyC I think of RJD's Holy Diver.
<CompanionCube>
it's very C-like
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
<Scripted>
ok then fuck me
<heat>
fuck you
<Scripted>
guess davis was too bored of assembly lol
<Scripted>
I never looked at holyc code so /shrug
<jimbzy>
Nah, he was just mentally ill, not stupid ;)
<heat>
geist: re: new returning null, isn't it a valid strategy to assume variables can't be null and just fail when you're out of memory
<CompanionCube>
also iirc templeos uses holyc as a scripting language which wouldn't work nearly as well in assembly.
<Scripted>
jimbzy: never said he was stupid
<Scripted>
he was a real programmer tho; he used protected mode
<mrvn>
heat: that's what noexcept does
<heat>
like what kernels can actually deal with OOM?
<heat>
you can have overcommit disabled, you can have rlimits on memory
<heat>
(or stricter overcommit)
<mrvn>
heat: you can. Who has?
<mrvn>
heat: and then what do you do? terminate
<heat>
depends on what you're doing
<mrvn>
The problem is that even if you check and handle the case and do everything right then overcommit will break it all.
<heat>
highly important security daemon shouldn't terminate on oom right?
<mrvn>
So it's kind of futile in most cases.
<mrvn>
heat: you can set an OOM score or disable it too
<heat>
i mean, at the end, oom is always batshit broken
<mrvn>
Can you turn of overcommit for a cgroup or single process?
<heat>
no clue
<CompanionCube>
the snarky response: for maximum security dynamic memory allocation is bad anyway :p
<heat>
the scientific method
<heat>
char array[4GB];
<mrvn>
GCC manages to tell you when it runs out of memory
<mrvn>
Might just check if the segfault is in the "my_malloc" function.
<heat>
i bet it's either an rlimit or a segfault handler
<mrvn>
heat: the later. but it knows when it is out-of-memory and when something else happened.
<Scripted>
Ok guys, I think that was it with osdev today
<Scripted>
thanks a lot for helping me
<Scripted>
cya tomorrow!
<jimbzy>
Cheers
Scripted has quit [Quit: WeeChat 3.4]
<heat>
yeah I know about the segfault handler
<heat>
i've managed to crash cc1 in Onyx
<mrvn>
Getting ICE from gcc always makes me hungry.
<heat>
it makes me angry but whatever floats your boat
<heat>
:P
<mrvn>
lets merge that and get hangry. you won't like me when I'm hangry.
* jimbzy
gives mrvn a Snickers
kaichiuchu has quit [Ping timeout: 240 seconds]
<geist>
hoenstly surprised there doesn't appear to be any good fs implementations, even fs walking code for FILES-11 ODS-2 filesystems (what openvms used)
<geist>
and, of course, unsurprisingly it looks like NTFS (or NTFS looks like it)
<heat>
context?
<geist>
i have a disk image of a VMS isntall
<geist>
curious what the file structure s
<geist>
curious what the file structure is
<geist>
(eep, getting used to pressing up and editing last line from discord/chat/etc)
freakazoid333 has quit [Ping timeout: 252 seconds]
dmh has quit [Quit: rip]
GeDaMo has quit [Remote host closed the connection]
gog has quit [Quit: byee]
_eryjus is now known as eryjus
freakazoid343 has joined #osdev
<mrvn>
lol [this slide intentionally left /void/]
_xor has quit [Read error: Connection reset by peer]
_xor has joined #osdev
Raito_Bezarius has quit [Ping timeout: 268 seconds]
CaCode has joined #osdev
heat has quit [Remote host closed the connection]
Raito_Bezarius has joined #osdev
Raito_Bezarius has quit [Max SendQ exceeded]
Raito_Bezarius has joined #osdev
CaCode has quit [Quit: Leaving]
nyah has quit [Remote host closed the connection]
Raito_Bezarius has quit [Max SendQ exceeded]
eryjus has quit [Ping timeout: 250 seconds]
Raito_Bezarius has joined #osdev
<blei>
anyone successfully used eye tracking for mouse control?