klange changed the topic of #osdev to: Operating System Development || Don't ask to ask---just ask! || For 3+ LoC, use a pastebin (for example https://gist.github.com/) || Stats + Old logs: http://osdev-logs.qzx.com New Logs: https://libera.irclog.whitequark.org/osdev || Visit https://wiki.osdev.org and https://forum.osdev.org || Books: https://wiki.osdev.org/Books
<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
<mrvn> *italien accent* scusy.
<mrvn> aka "pardon me"
<bslsk05> ​'Hexadecimal - The Queen of Chaos' by Icearchon (00:01:11)
<kazinsal> alright, got the SCSI2SD plugged into the connector labeled "1". let's see if she goes now
<klys> scsi2sd may not work with pc scsi hardware
<kazinsal> well, I'm installing it in a VAX, so
<klys> perticularly for my xt, I had to get an xtide card
rustyy_ has quit [Quit: leaving]
rustyy has joined #osdev
<kazinsal> okay, well, now I'm getting a cryptic as hell error that has "SCSI" in it, so that's... an improvement
<kazinsal> huh. okay, I don't know what this error means, but everything I care about is in show dev
<zid> kazinsal the scsi master
mahmutov has quit [Ping timeout: 272 seconds]
<geist> ooh that's good
<geist> i dunno if you have a scsi card in any other machine either, but i was able to test out the scsi2hd there first
<geist> but i have some symbios card in an old PC that seems to be pretty tolerant of anything
<kazinsal> interesting. I can get it to boot off a SCSI ID but it seems to have choked pretty early in trying to boot NetBSD
<kazinsal> interrupt stack pointer error. hm
<kazinsal> heh. tried to force it to continue and got a double fault
C-Man has joined #osdev
<geist> which netbsd?
<geist> i've found that recent ones are simply broken
<kazinsal> 9.2
<kazinsal> ah
<geist> i think i have 3.1 on it
<geist> they're also broken on SIMH, so i just dont think anyone is really maintaining it, or it only runs on a narrow set of hardware
<bslsk05> ​IRCCloud pastebin | Raw link: https://irccloud.com/pastebin/raw/N6cuzuKT
<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> oh i guess i was wrong, was getting it confused with SH: https://en.wikipedia.org/wiki/VAX#Virtual_memory_map
<bslsk05> ​en.wikipedia.org: VAX - Wikipedia
<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
<geist> well, not really: two competing companies
<zid> I'm surprised nobody ever /did/ it though, isn't solaris' source available?
<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> github.com/littlekernel/lk
<bslsk05> ​littlekernel/lk - LK embedded kernel (513 forks/2545 stargazers/NOASSERTION)
<geist> also https://github.com/travisg/newos is my super old one
<bslsk05> ​travisg/newos - The NewOS Operating System (34 forks/152 stargazers/NOASSERTION)
pieguy128 has quit [Quit: ZNC 1.8.2 - https://znc.in]
pieguy128 has joined #osdev
<geist> yeah dug out an old scsi drive and it's fine
<geist> had a netbds 3.0.3 install on it
<geist> and this one has VMS
<kazinsal> nice. I've got the VMS install finished but I need to grab the TCP/IP for OpenVMS 7 ISO to get it online
<kazinsal> currently (very slowly) installing NetBSD 5.1 on another SCSI ID
<CompanionCube> speaking purely hypothetically, there is also the way of magically finding a set of VMS PAKs :)
<geist> yah i just booted the old VMS isntall and it gave me like 10 pages of license having expired
<geist> the main problem here is i forgot the system password
<kazinsal> %LICENSE-W-EXPIRATION: you've been a naughty system operator
<geist> lovely that sending a BRK on the serial port always gets you back to firmware
<kazinsal> I do find it funny that VMS's console log format is the same as Cisco's. everyone loved ripping off VMS in the 80s
<kazinsal> though VMS uses an alphabetic character for severity level whereas IOS (being introduced much later) uses the numeric syslog severity level
tds has quit [Quit: Ping timeout (120 seconds)]
kazinsal has quit [Ping timeout: 250 seconds]
tds has joined #osdev
nohit has quit [Read error: Connection reset by peer]
XgF has quit [Remote host closed the connection]
kazinsal has joined #osdev
nohit has joined #osdev
XgF has joined #osdev
<CompanionCube> oof apparently vms software isn't allowed to offer VAX hobbyist licenses, only integrity/alpha and eventually x86
<bslsk05> ​www.macrelix.org: Index of /screenshots
<kazinsal> currently halfway through the netbsd sets... turns out decompressing gzip -9 tarballs on a VAX isn't exactly speedy
<jjuran> Jari--: Also, https://www.v68k.org/ams/
<bslsk05> ​www.v68k.org: Advanced Mac Substitute
<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
<GeDaMo> ¿Que?
<zid> a ? b¿ : c¿;
<bslsk05> ​'Family Guy - Brian tries to speak Spanish' by namster2k (00:00:23)
<mrvn> zid: It's usually ok once you are logged in.
C-Man has joined #osdev
nyah has joined #osdev
Scripted has joined #osdev
dennis95 has joined #osdev
xenos1984 has quit [Remote host closed the connection]
xenos1984 has joined #osdev
freakazoid333 has quit [Ping timeout: 240 seconds]
<mrvn> Isn't gcc using SSA now to compile/optimize? Why isn't a simple "int x = x;" giving a warning?
<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
<bslsk05> ​pastebin.com: bits32section .bssalign 16stack_bottom:resb 0x4000stack_top:section - Pastebin.com
<Scripted> I'm not sure what I'm doing wrong
<mrvn> put the .text section first to maximize the changce of the linker doing the right thing and putting the multiboot header first.
<Scripted> all right
<mrvn> you forgot to clear .bss before calling kmain.
<zid> 'invalid magic number panic'?
<Scripted> how can I do that?
<Scripted> yes
<zid> That was supposed to be where you elaborated
<Scripted> ah
<zid> my cpu doesn't have one of those, so presumably one of your tools is printing it
<bslsk05> ​wiki.osdev.org: Detecting Memory (x86) - OSDev Wiki
<mrvn> you also don't show where you ask for the memory map
<Scripted> at memory map via grub
<mrvn> *looking at magic-8 ball* Error printed by qemu -kernel
<Scripted> sorry what
<mrvn> What happened to pastebin? It's now more commercials than paste area.
<zid> scripted: you paraphased an error from.. some program
<zid> nobody knows which program or what error
<Scripted> ah
<zid> turns out if you just tell us, we can google what causes it, then look at your code to see which line you did that thing on
<bslsk05> ​pastebin.com: #include "kernel/kernel.h"#include "idt/idt.h"long khash(char *string){ - Pastebin.com
<Scripted> sorry
<zid> I absolutely never would have guessed that.
<zid> what's MULTIBOOT_HEADER_MAGIC declared as
<Scripted> I still told you though that I based my code on that code snippet on osdev
<zid> (or more likely, #defined as)
<Scripted> ?
<zid> >what's MULTIBOOT_HEADER_MAGIC declared as
<Scripted> it's in multiboot.h
<Scripted> let me link you it
<zid> you don't include that file
<bslsk05> ​www.gnu.org: Multiboot Specification version 0.6.96: multiboot.h
<Scripted> I do
<Scripted> it's in kernel.h
<zid> that's incredibly strange but okay
<bslsk05> ​pastebin.com: #pragma once#include <stdint.h>#include <stddef.h>#include "multiboot/mult - Pastebin.com
<zid> you have code in your header btw, don't do that.
<Scripted> you mean that integer variable?
<zid> line 13 will make a *copy* of an array in every file that includes it
<Scripted> oh shit I forgot to remove that, it was for my limine version
<mrvn> Why don't you just commit everything to git and put it on github or similar?
<zid> this would be trivially solved with a debugger, fwiw
<Scripted> mrvn: Because this is unfinished code
<Scripted> I'm updating my kernel regulary
<mrvn> so? push -f
<mrvn> or make a gist
<zid> git push is literally what you just did very painfully by hand
<zid> but properly and on a better website
<Scripted> so you mean push it into a testing branch?
<mrvn> for example
<Scripted> hmm, ok
<mrvn> check out gist.github.com too. You can put multiple files into a gist and edit them and people just have to hit reloead to see the changes.
<Scripted> heard of gist but never really got into it
<zid> got.. into it?
<zid> you make it sound like a bizzare fetish
<zid> it's just a website with a paste box, like the one you were just using
<Scripted> yeah I never used it
* mrvn wears a gists and clucks like a chicken. :)
<Scripted> Ok, I will use gist for now on
<mrvn> Are there other paste sites that let you edit the paste?
srjek has joined #osdev
<Scripted> yes
<bslsk05> ​hastebin.com: Just a moment...
<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?
<bslsk05> ​pastebin.com: .intel_syntax noprefix.section text.global _Oa_x64__halt.type _Oa_x64__h - Pastebin.com
<mrvn> what does the first fault say?
<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
<j`ey> junon: --orphan-handling=MODE
<bslsk05> ​sourceware.org: Options (LD)
<j`ey> I use this
<junon> ayyy thanks j`ey
<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> ​www.tortall.net: 9.2. ELF Sections
<zid> that's from the yasm manual but the table is nice
<zid> 0 .text 00000333 00000000 00000000 00000040 2**4
<zid> CONTENTS, ALLOC, LOAD, RELOC, READONLY, CODE
<zid> what readelf shows it as
<junon> I see okay
<zid> You'd have gone from 0 .text .rodata to .text .rodata text and it may have just worked, depending how your linker script works
<zid> as your 'ophan' would have had the right perms to merge
<junon> makes sense
<junon> for debug information, is that a PT_NOTE type?
<junon> or PT_NULL?
<zid> I'm not actually sure, I've never done it by hand
<zid> gcc and gdb organize that shit, I just either /DISCARD/ it or ignore it
Scripted has quit [Quit: WeeChat 3.4]
<junon> is there a way to get gcc to dump the linker script used?
<zid> yes but it's complicated and I don't remember how so I always just google it
<junon> oh /lib/x86_64-linux-gnu/ldscripts
<junon> neat
<j`ey> thee's also -Wl,Map=foo.map
<j`ey> that prints where the linker put everything
<zid> specs file will determine which one gets used
<zid> so it's easier to just make it dump the linker script rather than looking it up, in complicated configs
<junon> yay `/usr/bin/ld: error: unplaced orphan section `text' from `halt.S.o'`
<junon> caught it
<junon> thanks for the help :)
<zid> tbh I'd have just done asm("cli; 0: hlt; jmp b0"); or whatever
<zid> cus you know, it's 3 entire instructions
<junon> Yes I know :)
<mrvn> b0? shouldn't that be 0b?
<zid> 'or whatever'
<zid> aka
<zid> I know I fucked that up but I can't see why off the top of my head and it's a throw-away line for IRC
<zid> it just looks wrong
gog has quit [Quit: byee]
Burgundy has quit [Ping timeout: 272 seconds]
gog has joined #osdev
<junon> wow I really like stivale2
<junon> nicely put together project from what I can tell
<mrvn> "b00: b b00b"
* junon nods
<zid> what's a stivale2
<mrvn> EPARSE
<mrvn> .oO("I need to return a thingy")
<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]
<immibis> wow, the linux kernel is toying with the "struct linker" idea. https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/ (2 months old)
<bslsk05> ​lwn.net: [PATCH 0000/2297] [ANNOUNCE, RFC] "Fast Kernel Headers" Tree -v1: Eliminate the Linux kernel's "Dependency Hell" [LWN.net]
xenos1984 has joined #osdev
<immibis> "struct linker": https://yosefk.com/blog/i-want-a-struct-linker.html (13 years old)
<bslsk05> ​yosefk.com: I want a struct linker
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
mrvn has quit [Client Quit]
mrvn has joined #osdev
<mrvn> re, on ssl again
dennis95 has quit [Quit: Leaving]
srjek|home has joined #osdev
srjek_ has joined #osdev
srjek has quit [Ping timeout: 240 seconds]
srjek|home has quit [Ping timeout: 256 seconds]
nj0rd has quit [*.net *.split]
alpha2023 has quit [*.net *.split]
rb has quit [*.net *.split]
netbsduser has quit [*.net *.split]
MiningMarsh has quit [*.net *.split]
ssiyad has quit [*.net *.split]
Scripted has joined #osdev
Burgundy has joined #osdev
dormito has joined #osdev
dude12312414 has joined #osdev
MiningMarsh has joined #osdev
rb has joined #osdev
alpha2023 has joined #osdev
ssiyad has joined #osdev
nj0rd has joined #osdev
netbsduser has joined #osdev
dormito has quit [Ping timeout: 240 seconds]
dude12312414 has quit [Client Quit]
srjek has joined #osdev
srjek_ has quit [Ping timeout: 256 seconds]
dormito has joined #osdev
thaumavorio has quit [Quit: ZNC 1.8.2 - https://znc.in]
thaumavorio has joined #osdev
<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> ​github.com: CrazeOS/src/string at main · ScriptedDeveloper/CrazeOS · GitHub
<Scripted> whoops, wrong link
<bslsk05> ​ScriptedDeveloper/CrazeOS - An amateur work-in-progress OS written from scratch! (0 forks/1 stargazers)
<Scripted> The issue is at kernel/kernel.c
<mrvn> ito of a random ineter will just return 0. and 0 == 0
<mrvn> s/ineter/integer/
<Scripted> so it's not the same?
<mrvn> inconclusive
<mrvn> What does it say when you print the two values?
<Scripted> it's the same
<Scripted> I can only print those values with the itoa() function
<mrvn> you need a print a hexadezimal.
<Scripted> yeah well my print function does not support that
<Scripted> I already tried
<mrvn> or dezimal if you must
<Scripted> the problem is about numbers
<mrvn> scripted: don't include tons of unreleates headers in kernel.h
<Scripted> I use it to include all headers
<Scripted> so I only have to include kernel.h in other dirs
<mrvn> bad style. Only include what you need for the rest of kernel.h. Include what you need for kernel.c in kernel.c
<Scripted> yes but why would I include for example stdint 10x times
<Scripted> if I can do it once
<mrvn> so that only the files using stdint.h will recompile when you change stdint.h and everything compiles faster
<Scripted> Ok, I will do that
<Scripted> but that's not the problem right now
<Scripted> how can I check if the values are the same?
<Scripted> obviously something went wrong
<mrvn> scripted: see https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/ what it takes to fix stuff like that later
<bslsk05> ​lwn.net: [PATCH 0000/2297] [ANNOUNCE, RFC] "Fast Kernel Headers" Tree -v1: Eliminate the Linux kernel's "Dependency Hell" [LWN.net]
<Scripted> hmm ok
<mrvn> write a print_hex or int_to_hex function
<mrvn> then do what everyone calls printf debugging. Print out the values and check they are what you expect them to be.
<mrvn> Do print the constant too, not just the bootloader magic. Sometimes the error is that the constant gets messed up somehow.
<Scripted> which constant?
<Scripted> you mean the #define?
<Scripted> sure as hell I'll do that
<mrvn> the one that's no longer in kernel.c :)
<Scripted> shouldn't it be possible to turn that integer into a hex with the itoa function?
<mrvn> MULTIBOOT_HEADER_MAGIC
<Scripted> mrvn: yeah, that's which constant I meant
<mrvn> scripted: itoa returns a char* to some internal buffer. ANd you check if the address is the same.
<Scripted> well yes
<Scripted> I just tried with the itoa() function
<Scripted> and it's literally the same
<Scripted> with hex
<mrvn> Looking at your itoa what you do compare is the 2 numbers have the same order of magnitude.
<Scripted> it does
<Scripted> so I have to find another method
<mrvn> what does it print?
<Scripted> "got 2badb002 but need 2badb002"
<mrvn> then comparing the values directly should just work
<Scripted> yeah I did that
<Scripted> it's not the same
<mrvn> uint64_t magic; are you sure that is correct?
<Scripted> ......
<Scripted> oh my god
<Scripted> hold up
<mrvn> I told you not to edit that file. :)
<Scripted> my magic variable in the kernel.c file is uint32_t
<Scripted> which is correct
<mrvn> When you call itoa() the type is narrowed to int.
<Scripted> yes it is
<mrvn> Yout struct multiboot_header is broken I believe
<Scripted> and in multiboot.h it's uint64_t
<Scripted> hold up let me send you it
<Scripted> this time over gist
<mrvn> You need an itoa that takes 64bit values.
<bslsk05> ​gist.github.com: multiboot.h · GitHub
<GeDaMo> ltoa?
<Scripted> ok well then I have to code up an entire new itoa
<Scripted> or can I just change the variable type?
<Scripted> which I doubt would work
<mrvn> scripted: original file has: multiboot_uint32_t magic
<Scripted> orignal file has unsigned int
<mrvn> scripted: you can just change the type if you make the buffer large enough.
<mrvn> If you fix your multiboot.h everything should work.
<geist> kazinsal: haha yeah re: ssh on vax you're gonna want telnet
<mrvn> geist: ssh -c none?
<geist> even some old 90s sparcstations it can take like a minute to log in over ssh
<geist> and then it uses basically full cpu
<Scripted> I think I've been using an old version of multiboot.h
<geist> yeah, exept modern sshs dont let you do that
<geist> but.... arcfour if still allowed is i've found to be the cheapest cipher
<mrvn> geist: it's a compile time option defaulting to off. Mut I think there is something close to it that does HMAC with plaintext inbetween.
<bslsk05> ​www.gnu.org: Multiboot Specification version 0.6.96: multiboot.h
* geist nods
<Scripted> I ain't taking my dependencies from github no more
<geist> also of course default ssh compression to off
<mrvn> For old system I really just want ssh to auth me and then be telnet.
<Scripted> mrvn: I just used the original one and it did not fix my problem
<mrvn> did you change itoa to lltoa?
<Scripted> no let me do that
<Scripted> so basically just change the int parameter to uint64_t and the index variable during the for loop from int to long?
<Scripted> or size_t
dormito has quit [Ping timeout: 250 seconds]
<mrvn> I broke stackoverflow :)
<Scripted> how
<mrvn> try it
<Scripted> I can't access it..
<Scripted> WHAT DID YOU DO
<mrvn> well, nothing. that was a joke.
<Scripted> stackoverflow is more important than google
<Scripted> I seriously can't access it
<mrvn> I know.
<mrvn> "Routine maintenance" so *I* didn't break it. It's just offline.
<Scripted> nvm
<Scripted> it loaded up
<Scripted> also, using literally any lltoa function online causes my linker to bark at me
<Scripted> with this
<Scripted> (.text+0x277): undefined reference to `__divdi3'
<mrvn> missing libgcc
<Scripted> :triumph:
<GeDaMo> Are you converting to decimal or hex?
<mrvn> GeDaMo: variable base argument
<GeDaMo> Yeah, but I was wondering if they needed decimal, hex doesn't need dvision
<mrvn> it's the worst case: 64bit / 64bit with nothing known.
<mrvn> Although gcc (8 or whatever I had) doesn't optimize out "x / 10"
<Scripted> mrvn: would be decimal fine too?
<Scripted> I dont want to go through the pain of implementing libgcc
<Scripted> I'm such a lazy bastard
<clever> then just -lgcc?
<mrvn> scripted: just add -lgcc
<Scripted> yeah I tried that
<Scripted> that doesn't do nothing
<mrvn> at the right place. order matters
<Scripted> according to osdev, I also have to link it using my linker
<Scripted> if I want to
<mrvn> you only have to link it
<Scripted> how is this not right?
<Scripted> %.o: %.c
<Scripted> $(CC) $(CFLAGS) -c $^ -o $@ -T ../link.ld -lgcc
<mrvn> that's not linking
<Scripted> oh linking..
<mrvn> -T is wrong there too
<Scripted> ah, yes
<Scripted> it has to be at the beginning
pretty_dumm_guy has joined #osdev
<geist> -T you use when linking
<Scripted> yes
<Scripted> how do I tell my linker where libgcc is?
<mrvn> use $(CC) to link
<Scripted> yes but how do I link libgcc
<heat> -lgcc
<Scripted> I did that
<Scripted> but I think I'm doing something wrong, otherwise I wouldn't get the same error
<heat> you sure?
<Scripted> I think so
<mrvn> push the code
<heat> do you still get that same error? are you sure the command is correct?
<heat> did you erm, run make
<bslsk05> ​gist.github.com: Makefile · GitHub
<Scripted> yes
<Scripted> I ain't that stupid lolol
<heat> use
<heat> a
<heat> cross
<heat> compiler
<heat> kthx
<Scripted> aaaaaaaaaaaaaaaaah
<Scripted> okay
<Scripted> cross compiler for x86
<mrvn> You are not linking with CC
<Scripted> you mean I don't link the libgcc file with cc?
<mrvn> you neither link libgcc nor use gcc to link
<mrvn> and still pass -T to compile
<mrvn> So basically everything we talked about in the last half hour you didn't fix
<Scripted> kinda been googling the whole time
<heat> google is bad
<heat> bing it
<Scripted> yeah I've been googling the entire time what the heck you mean
<Scripted> found no answers on osdev
<GeDaMo> You're getting answers in here and ignoring them :|
<Scripted> GeDaMo: no I'm not
<Scripted> I really don
<heat> -lgcc is for the link
<Scripted> I really don't understand how I should link with libgcc
<heat> not compilation
<Scripted> yes this is what I do
<heat> have you never used gcc?
<Scripted> yes of course
<heat> this is not what you're doing
<Scripted> I did
<bslsk05> ​gist.github.com: Makefile · GitHub
<Scripted> I did pass -lgcc
<heat> is that the link command?
<Scripted> no
<Scripted> if I pass -lgcc in the link command it doesn't work
<GeDaMo> Don't use $(LD) use $(CC) to link
<heat> if you pass -lgcc in the compile commands it sure as hell won't work
<GeDaMo> Or change LD to be gcc
<Scripted> ok
<Scripted> that made sense now
<Scripted> thank you
<Scripted> but how di I link with gcc and use x86?
<Scripted> *do
<GeDaMo> gcc is the frontend to the GNU Compiler Collection
<GeDaMo> It calls other program to compile and link
<Scripted> Okay
<heat> gcc without -c links
<heat> gcc with -c compiles
<heat> if you want to pass certain options directly to the linker, you use -Wl,option
<heat> like -Wl,-T link.ld
particleflux has quit [Quit: 418 I'm a teapot]
particleflux has joined #osdev
<Scripted> OK, this is what I have so far
<Scripted> using a different linker gives me still weird errors like
<Scripted> warning: creating DT_TEXTREL in a PIE
<heat> that's because you're not using a cross compiler and your toolchain is default PIE
<heat> -fno-PIE
<Scripted> okay
<Scripted> passing this flag doesn't fix the issue
<clever> did you pass it to the compiler or linker?
<Scripted> compiler
<clever> and did you rebuild the .o file? make often ignores changes to the Makefile
<Scripted> yes
<heat> -fno-PIE needs to be passed to both the compiler and linker
<Scripted> that didn't fix it
<clever> the libgcc itself may also need to be compiled in -fno-PIE mode
<clever> thats probably why all the guides say to use a proper baremetal cross-compiler
<heat> libgccs are compiled as pic
<heat> that's not the issue
_eryjus has quit [Read error: Connection reset by peer]
<clever> nvm then, lol
_eryjus has joined #osdev
<heat> (all libgccs for hosted targets like linux, freebsd, etc; most baremetal ones are compiled position dependent with mcmodel=small)
mahmutov_ has joined #osdev
<Scripted> this is it so far:
mahmutov has quit [Ping timeout: 272 seconds]
<heat> <heat> if you want to pass certain options directly to the linker, you use -Wl,option
<heat> <heat> like -Wl,-T link.ld
<heat> this heat persona is super smart, you should listen to him
<clever> scripted: does it say which file is causing the problem? which symbol?
<Scripted> using this makes me get some other issues
<Scripted> clever: it's saying this:
<clever> (.text+0x22): undefined reference to `main'
<clever> it cant find main, so it created a relocation for the runtime linker to fill in later
<Scripted> I don't have no main variable in my assembly file
<clever> /lib32/Scrt1.o: in function _start':
<mrvn> you forgot the freestanding that you need because you aren't cross-compiling
<clever> you didnt pass the no start files flag, so the standard crt files got linked in automatically
<Scripted> ok I do have start
<Scripted> okay
<Scripted> let me fix that
<clever> those crt files expect a standard glibc and main()
<mrvn> building a kernel with a normal compiler is hard
FatalNIX has joined #osdev
<clever> arm64/Makefile:CFLAGS = -nostdlib -nostartfiles -ffreestanding -g
<clever> one of those will fix it
* clever wonders off
<Scripted> clever: yeah well that fixed it to 80%
<Scripted> okay so
<heat> <heat> use
<heat> <heat> a
<heat> <heat> kthx
<heat> <heat> compiler
<heat> <heat> cross
<Scripted> -g is a linker flag, right?
<heat> omg he is so smart
<heat> wow
<Scripted> heat: I told you I will!!!
<Scripted> just not today
<Scripted> clever: well no, it didn't
<Scripted> not sure if I implemented it correctly though
<geist> re libgcc.a i usually use `-print-libgcc-file-name`
<geist> which gives you a hard path for the .a file
<mrvn> geist: and link with LD?
<geist> and then i just include it on the command line, that way it works no matter what your linker search path is, etc
<geist> usually yes,but it works with gcc as the linker too
<geist> since you're just giving it a hard .a path
<geist> and you can get the path with something like `LIBGCC_PATH := $(shell $(CC) -print-libgcc-file-name)
<geist> `
<bslsk05> ​github.com: 3x86/makefile at master · travisg/3x86 · GitHub
<bslsk05> ​github.com: 3x86/makefile at master · travisg/3x86 · GitHub
<gog> -nostartfiles and -nostdlib should be LDFLAGS
<geist> also you can remove -T and -lgcc for the compile lines, unnecessary
<Scripted> gog: that didn't change much either
<heat> geist, i'm upset that your makeflop.c has -v and it's not verbose nor version
<heat> that would be a crime punishable by death if I were in charge
<Scripted> gog: so sorry it actually did
<geist> hmm, ow old are you?
<geist> makeflop is like one of the first things i ever wrote
<Scripted> it finally works
<Scripted> thanks a ton
<geist> i think it gets a pass :)
<geist> but you're right
<heat> geist, it's one year older than me :P
<Scripted> thanks everyone who helped me
<geist> hehe
<geist> scripted: cool! can you pastebin the working version?
<geist> heat: i copied it out of newos, but yeah it's definitely code written by young me
<geist> if i cared to fix it i'd probably switch it to getopt and do switches properly. feel free to fix it!
<geist> the 3x86 thing was just a little fun weekend hack to build a little silly kernel for the 386 i had in front of me
<geist> i had some grand idea of only using features of the 386, or even 286 protected mode
<geist> fiddled with TSS task switching, etc
<Scripted> geist: sure, I just updated it. It's the link to that gist.
<Scripted> But I will also update it in my main repo
<Scripted> once I'm finished something worth committing
<Scripted> *with adding
<geist> cool, looks at first glance pretty good
<Scripted> thank you
<geist> you'll probably want to do the whole header file dep thing
<geist> see the makefile i linked for a simple thing
<Scripted> geist: you mean to avoid a dep hell?
<geist> yah, it's a standard trick to do the whole `-MD -MP -MT $@ -MF $(@:%o=%d)` stuff and then include the generated .d files into the makefile
<geist> so that subsequent buids properly track changes in header files
<Scripted> I feel like this whole effort was for nothing
<geist> why so?
<Scripted> I got the exact same fucking result I got before adding libgcc
<geist> doesn't mean you didnt' fix bugs
<geist> it's possible to have multiple problems, and you may have fixed a few but still have some
<Scripted> D"got 2badb002 but need 2badb002"
<Scripted> could literally just throw my pc out of the window
<mrvn> push it
<Scripted> or even install windows
<geist> well, submit the code and push it first heh
<Scripted> mrvn: Push what?
<mrvn> all the changes you made
<geist> defenestration is not the solution
<geist> but if so, push to github first :)
<mrvn> and what was the url again?
<Scripted> hell it is
<Scripted> last time I pushed something on github I almost destroyed my entire repo
<mrvn> scripted: did you make a test branch like you wanted to?
<Scripted> No
<Scripted> that's where the fun started
<heat> geist, you could've gotten to userspace :/
* geist shrugs
xenos1984 has quit [Remote host closed the connection]
<geist> yah well i hacked on it for a few weeks and then decided it probably was better spent getting LK to run properly on 386
<geist> which i then did
<heat> it runs on 386?
<geist> i added a 'legacy' compile mode for LK so it'd run on the same hardware
<geist> yah
<heat> nice
<heat> I think linux doesn't
<heat> hmm what happens to atomics?
xenos1984 has joined #osdev
<mrvn> Does clang have a freestanding libstdc++?
<heat> do they just compile to regular instructions?
<Scripted> off-topic, but are you guys in university?
<heat> mrvn, no
<heat> mrvn: you have your freestanding headers but most of libstdc++ in naturally hosted
<heat> *is
<mrvn> heat: no. atomics add memory barriers as needed by the specified model
<mrvn> heat: stuff like alignof, tons of type traits, ... would be freestanding.
<mrvn> atomics
<heat> yes and that is freestanding
<heat> atomics aren't freestanding sometimes (see libatomic)
<geist> heat: on 386? i dont think it has cmpxchg yet (may be a 486 thing?_
<geist> i think i may only have swp at that poit
<geist> but for non SMP you always have the option of just disabling ints, doing the math, and reenabling it
<geist> standard technique
<mrvn> geist: that requires OS help
<geist> for kernel space yeah, for user space you're right, needs OS help
<geist> so the other strategy i've seen is to build a spinlock like system
<mrvn> Is 386 supported by gcc/clang libstdc++?
<geist> where you use a swp instruction (if present) to write to a global the address of the atomic you're about to do work on
<geist> and then do it, and clear it
<geist> and if it's already set, spin
<geist> or i suppose use a futex or somethin
<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: GitHub - ScriptedDeveloper/CrazeOS at testing
<mrvn> geist: hehe, I'm currently fighting with containers that new/delete.
<geist> heat: yeah arm64 does too. i dislike it, seems like you shoudl be able to set at least a pragma or assembler directive to ignore that
<mrvn> Sometimes you don't want intrusive containers.
<heat> geist: and this reminds me: your riscv code explicitly encodes the instruction, but there's a workaround: https://github.com/heatd/Onyx/blob/master/kernel/arch/riscv64/fpu_state.S#L9
<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?
pretty_dumm_guy has joined #osdev
<geist> heat: probably want to at least more gracefully deal with it
<mrvn> heat: linux can, sort of. :)
<heat> linux panics
<mrvn> linux kills your ssh session
<Scripted> ok this is very c like
<Scripted> no wonder it's called holyC and not holyASM
<CompanionCube> also templeos doesn't use protected mode, it's 64-bit long mode
<heat> if linux can't OOM-kill, and it can't swap, and it can't empty any cache, it will panic
<mrvn> heat: yeah, you have to be very desperate for it to panic.
<Scripted> wait
<Scripted> CompanionCube: https://en.wikipedia.org/wiki/TempleOS
<bslsk05> ​en.wikipedia.org: TempleOS - Wikipedia
<Scripted> it says here it uses x86 ASM and C
<Scripted> *holyC
<CompanionCube> yes, as does every operating system
<heat> mrvn, my theory is that checking for null is futile since you eventually just panic
<mrvn> heat: you have lots of places where on out-of-memory you try to free some and retry.
<Scripted> wait, but since when can you use x86 asm in real mode?
<GeDaMo> :|
<CompanionCube> ...
<Scripted> yeah sorry I'm stupid
* jimbzy holds GeDaMo and CompanionCube back.
<heat> mrvn, lots? maybe not so
<mrvn> heat: in user space checking for NULL is pointless. You always get memory unless you ask for something insane and then SEGFAULT on access.
<heat> it's not
<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?
FireFly has quit [Ping timeout: 240 seconds]
FireFly has joined #osdev
blei has quit [Ping timeout: 256 seconds]
gog has joined #osdev
Clockface has joined #osdev
<bslsk05> ​pastebin.com: compstring:mov byte [bx], almov byte [si], ahcmp al, ahjne compstrin - Pastebin.com
<Clockface> it has taken me longer than i would like to admit to figure out why this compare string function is only returning equal in CX
<Clockface> i do not know what is wrong with it but something is
<mrvn> are you actually writing asm?
<Clockface> yes
<mrvn> bad indentations. How am I supposed to find the labels? :)
<mrvn> you realize x86 has string support in the cpu, right?
<Mutabah> `cmpsb` - quite a nice instruction
<mrvn> loops till it hits 0 on it's own too
<Mutabah> well, iirc it loops until cx==0
<Mutabah> or is there a variant that stops when src/dst is zero?
<mrvn> Mutabah: iirc there is one for memcmp and one for strcmp
<Clockface> when did that add cmpsb?
<Mutabah> 8086
<mrvn> Clockface: are you implementing <, =, > or <=>?
<Mutabah> Clockface: Convention is to use `ax` for return values
<mrvn> Mutabah: that's C. far too highlevel
<Clockface> this thing isnt supposed to contain any C just yet
<Clockface> i only plan on using this function in one spot anyways
<mrvn> looks ok to me
<Clockface> i might just be calling it weird
<Mutabah> The code looks "good"
<Mutabah> just be aware of the calling convention it uses
<mrvn> while(true) { if (*a != *b) return 0; if (*a == 0) return 1; ++a; ++b; }
<Mutabah> It clobbers bx, si, ax, cs
<Mutabah> (usually you'd use `si` and `di` for memory ranges)
<mrvn> Clockface: what input gives bad results?
<Mutabah> also - I think that you can `cmp` without loading, so no need for `ah`
<Clockface> once i fix it ill declobber it
<mrvn> Mutabah: lets fix it before we optimize
<Mutabah> mrvn: No fun :)
<mrvn> Clockface: you know what operator <=> is?
<Clockface> no?
<mrvn> do you know what strcmp() normally returns?
<Clockface> it just checks if the 2 strings contain the same stuff
<Clockface> mine does at least
<Clockface> no?
<Clockface> i havent done much C
<mrvn> it gives you a negative, 0 or positive depending on how the strings compare. not just a bool.
<mrvn> it's usualy "al - ah" where they differ.
<Mutabah> ^ you can think of it as similar to the `cmp` instruction
<Clockface> but strings are not numbers?
<mrvn> chars are
<Clockface> yeah true
<Clockface> but i dont need that for now
<mrvn> to make a long story short: the point is it gives you <, = and > in one function and you can just branch on it.
<mrvn> anyway, back to the bug: What input goes bad?