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
<Clockface> its only outputting CX = 1
<mrvn> so "a" and "b" will give 1?
<Clockface> yes
<mrvn> can you single step it in a debugger?
<mrvn> I bet it's not going wrong where you think it goes wrong. :)
<mrvn> "usually you'd use `si` and `di` for memory ranges" That's one of the big reasons why I don't write a bootloader for x86.
<mrvn> 16bit registers are so limiting.
<Clockface> this goes in a PIE and DI is what im using to store the offset
sonny has joined #osdev
<graphitemaster> 16 bits outta be 'nuff for ne 1
<Mutabah> iirc, `bx` is the register conventionally (at least in 32-bit mode) for PIC
<Clockface> ah
<mrvn> ax = accumulator, bx = base, cx = counter, dx = data, I heard division register too, si/di index, ip pointer, bp base pointer, sp stack
<mrvn> And just by seeing how they all have unique names you can see how not general purpose they are.
<Mutabah> Yep. Most of them are quite generic, but e.g. the string functions use si/di, rep uses cx, division is hardcoded to use ax/dx
<Mutabah> and on pre-32-bit CPUs, the addressing modes are relatively limited (based on patterns of registers)
<mrvn> Mutabah: if you think about it none of them are generic.
<mrvn> just some overlap but every one has a special function.-
<Mutabah> Point really. I've spent too long in 32-bit mode
<Mutabah> where that specialisation is reduced
<mrvn> Is there any of it left on amd64?
<Mutabah> `div` and the string intstructions
<mrvn> In C you really stop noticing.
[itchyjunk] has quit [Ping timeout: 250 seconds]
<mrvn> Clockface: what does single stepping in a debugger say about ah and al?
[itchyjunk] has joined #osdev
<Clockface> does moving al or ah clobber the other half of the register?
<Clockface> i dont think it does
xenos1984 has quit [Read error: Connection reset by peer]
<Mutabah> It doesn't
<mrvn> oepration: Destination = Source. says nothing about clobbering anything
<Clockface> yeah i thought so
<Clockface> i have no clue what is wrong with this
<mrvn> My guess at this point is that bx/si are wrong.
<mrvn> comstring is fine but you aren't comparing the right thing.
<gog> why not use cmpsb
<mrvn> gog: too optimized :)
<gog> repe cmpsb
<Clockface> i wish i did
<gog> jne compstring_unequal
<Clockface> but at this point i just want this to work
<Clockface> as in, im this far in
<Clockface> i might as well fix it
<Clockface> then i will never write another function like this
<gog> or repnz i guess idk
<gog> repne and repnz both work but the condition is the same
<gog> hm
<mrvn> gog: how do you make them stop at \0?
<Clockface> well
<Clockface> it works if i call my print function
<Clockface> that works
<mrvn> gog: looks like you have to cx = strlen() first
<gog> yeah
<mrvn> I thought x86 had rep* stuff that works on \0 terminated strings.
<gog> reading the cmps doc now
<gog> ok you can do it in a loop
<gog> es:di and ds:si as the strings to compare
<Clockface> ok
<gog> cmps
<gog> then the conditionals
xenos1984 has joined #osdev
<gog> jnz back to the cmps
<gog> or idk
<mrvn> so basically just saving the 2 "inc"
Burgundy has left #osdev [#osdev]
gog has quit [Quit: byee]
kingoffrance has joined #osdev
sonny has quit [Ping timeout: 256 seconds]
<mrvn> What'S up with stackoverflow? it keeps crashing
<kazinsal> the whole net's been on the fritz lately
<mrvn> "Routine maintenance" my ass.
<kazinsal> wikipedia, SO, the goog
<mrvn> kazinsal: local copy?
<kazinsal> turns out a land war in eurasia wherein one party is known for fucking with the internet is detrimental to the internet
sonny has joined #osdev
sonny has quit [Quit: Ping timeout (120 seconds)]
sonny has joined #osdev
<sonny> Is openbsd pledge() a capability?
<kingoffrance> sounds like https://dlang.org/spec/contracts.html
<bslsk05> ​dlang.org: Contract Programming - D Programming Language
<kingoffrance> "promises" that was the word i was looking for. but thats "contract". that doesnt answer your q...
<kingoffrance> to me, capabilities sounds like it would build up, to what is needed. rather than voluntarily "drop down" to restricted
<kingoffrance> but that is speculation, someone else jump in please
<mrvn> C++20/23 is so much better (again) than c++11 and c++17. Now if only I had linear types.
<mrvn> kingoffrance: promises as in futures?
<kingoffrance> i yield to someone who knows actual terminology :D yeah
<kingoffrance> just like futures contracts lol
<mrvn> I believe pledge() is something completly different than promise/future.
<mrvn> sonny: From the manpage I gather that pledge gives up capabilities.
<sonny> mrvn do you mean that it is an alternative altogether?
<mrvn> "I promise from now on I will only do {x,y,z}"
<kingoffrance> ^ yeah it seems to use such terms but in a particular sense https://man.openbsd.org/pledge.2
<bslsk05> ​man.openbsd.org: pledge(2) - OpenBSD manual pages
Jari-- has joined #osdev
<kingoffrance> three kinds of definitions: what person 1 wrote. what other person wrote. what the word actually means (general sense) lol
<mrvn> So forget that the first argument is named "promise". It has nothing to do with promises/futures.
<sonny> ok, so it allows you to administer security by say having a program meet requirements {x, y, z} whereas before there is no way to verify?
<mrvn> sonny: As I understand it it restricts syscalls to less dangerous things.
<sonny> ok
<mrvn> From do everything down to "you can only call exit()"
<mrvn> gradually
<mrvn> And you can only give up things.
<mrvn> i.e. capabilities
<mrvn> Too bad this isn't specified to act on threads. I would love to set worker threads up to do less.
<kingoffrance> freebsd had systemwide https://www.freebsd.org/cgi/man.cgi?securelevel which im not sure ive seen people really use it, but starts wide open, you can restrict further Any super-user process can raise the level, but no process can lower it
<bslsk05> ​www.freebsd.org: securelevel
<sonny> yeah that'd be nice
<kingoffrance> which is not to disparage pledge, just similar "starts wide open" then "restrict"
sonny has quit [Ping timeout: 256 seconds]
<kingoffrance> minor point but what i keep driving at: https://en.wikipedia.org/wiki/Capability-based_security In theory, a system with capabilities removes the need for any access control list or similar mechanism by giving all entities all and only the capabilities they will actually need.
<bslsk05> ​en.wikipedia.org: Capability-based security - Wikipedia
<kingoffrance> *only* are there any actual such pure systems? i dont know
<kingoffrance> which is just to say, other than things expressly designed from the ground up, hybrid is what one is likely to encounter
<mrvn> A program might have the capability to write to files but also have read-only files.
<mrvn> I think you can replace access control lists with capabilities but isn't that just renaming everything from ACL to CAP?
<kingoffrance> i dont know the terms :/ just one seems "pure" the other seems "bolting onto another system, this is what is practical"
<kingoffrance> the latter seems where the "revoke" comes from
<kingoffrance> "we're all outta virgins" -- baron munchauser
<kingoffrance> *chausen
<mrvn> I think ACL are persistent while capabilities are something you have to establish over and over
<mrvn> With capabilities you also don't have any mechanism to "chmod a+r file". Do you open a socket to every process and then them a capability token?
<mrvn> Maybe think of an ACL as a store of capabilities. When you open a file the ACL say which capabilities you gain for that file.
srjek has quit [Ping timeout: 250 seconds]
heat has joined #osdev
<kingoffrance> "we're all out of eroses"
ElectronApps has joined #osdev
lainon has joined #osdev
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
lainon has quit [Quit: Leaving]
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #osdev
heat has quit [Remote host closed the connection]
eryjus has joined #osdev
sonny has joined #osdev
bradd has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
bradd has joined #osdev
sonny has left #osdev [#osdev]
FatalNIX has joined #osdev
zaquest has quit [Remote host closed the connection]
bradd has quit [Remote host closed the connection]
zaquest has joined #osdev
rustyy has quit [Quit: leaving]
rustyy has joined #osdev
bradd has joined #osdev
<Clockface> what key single steps qemu when it is paused?
<Clockface> nvm
<klange> None? You attach GDB and use `s`.
ElectronApps has quit [Quit: Leaving]
<kingoffrance> "capabilities are something you have to establish over and over" yeah reminds me of cookies/tickets/tokens, although they may not like those terms/that comparison. .oO( "no ticket!" ) .oO( unix hater handbook, if you give a window system a cookie children's story )
<kingoffrance> ENOTICKET would be better
<CompanionCube> why not EPERM
<CompanionCube> ENOSPC for those error codes
<CompanionCube> lol
<CompanionCube> changemode all read,write,execute current directory
<Clockface> how to run gdb until PC reaches a certain point?
<Clockface> is there a way to do that?
<Clockface> nevermind
<Clockface> i need to learn how gdb works
<kingoffrance> EGOTOFFMYPLANE
<kingoffrance> *GET
<kazinsal> ELAWN: the process whose memory you are trying to access is an ancestor process that has decreed you shall not be on its lawn
<kingoffrance> i like that
<CompanionCube> ECLOUD: process up too long, angry packets routed to cloud.
Jari-- has quit [Remote host closed the connection]
<geist> kazinsal: so as far as i can tell the scsi2sd 6.0 i have just died
<geist> like, i can talk to it over the usb cable, reprogram it, read the data off the disks that way
<geist> but plugged into a scsi card either to the vax or a PC. nothing
<geist> like it doesn't power up
<kazinsal> oh wow. guess the SCSI controller croaked?
<geist> i dunno
<geist> or the power supply portion of it broke
<geist> since it can and does power off the usb side of it just fine
<kazinsal> hmm. what's your power delivery? 4 pin or scsi termination power?
<geist> 4 pin
GeDaMo has joined #osdev
<geist> and i scoped it to see. i might put it on the bench and piddle with it more closely tomorrow
<kazinsal> hmm. wonder if the 6.0 can run off scsi termination or if it's just the 5.2 that does
<geist> it has a unpopulated jumper for scsi termination
<kazinsal> ah. the 5.2 does the termination in firmware and powers itself off the active terminator bus power
<kazinsal> I don't have the 4 pin plugged in on the one in my vax, just the scsi cable
<geist> ah but your'e using a 5.2
<geist> did you get it working though?
<kazinsal> yeah
<kazinsal> yep! still having some weird soft error in firmware
<kazinsal> on the vax that is
<kazinsal> can't figure out exactly what it means because I can't actually find the exact manual for the microvax 3100/40
<kazinsal> and the microvax 3100/{10,20} and vaxstation 3100/40 use different firmware from the microvax 3100/40
<geist> yah looksl ike mine has slightly newer firmware too
<geist> 4.2 vs 4.0 i thiunk
<kazinsal> I have the V1.2-343-V4.0 firmware and it has a completely different set of TEST commands and a different POST display than the manuals
<kazinsal> I just get a progress bar in block characters instead of the "F...E...D...C..." etc described in the manual
<geist> when investigating how to detect what vax you were booted on, it's a real mess
<geist> there's very little standardized post boot either
<geist> lots of this this than not that sort of stuff
<kazinsal> and the manual says to punch in "TEST 50" to get a full config output, and that just gives me an ? ILL ARG
<kazinsal> on boot I get `?? 001 10 SCSI 0048` and doing SHOW ERROR gives me ``?? 001 10 SCSI 0030`
<kazinsal> so the VAX can't quite make up its mind as to what exactly the problem is
<kazinsal> I thiiiiink it might be because I don't have a terminator on the external SCSI port
<geist> ah yeah, i do
<geist> it's a weird loop i've never seen. the internal cable literally loops all the way aorund with 6 connectors on it
<kazinsal> yeah, it's bizarre
<geist> but i know the controller and cable is fine, since it works fine wiht a scsi drive in it
<kazinsal> I had the SCSI2SD in the "4" connector at first and it wasn't detected so I plugged it into the "1" connector and poof, worked fine
<kazinsal> only remaining issue is that 0048/0030, neither of which I can find any details on
<geist> see i thought that too, but i have plugged a scsi hard drive in differnt ports and it doesn't matter
<kazinsal> hmm
<geist> also tried it with an without the tape drive, whcih coems up as id 5
<kazinsal> I should probably grab an external SCSI terminator...
<geist> but i know this all worked at some point, so the occams razor is the scsi2sd died or is having some issue
<geist> will try to scope it out tomorrow maybe
<kazinsal> of course there's no 68-pin terminators for sale in canada on eBay
<bslsk05> ​xlark.sdf.org: Resurrecting the VAXen, part 3: Hardware Repairs | Clark Hale’s Blog
<geist> yah i've been curating a set of scsi cards and cables over 20 something years
<GeDaMo> "The last remaining issue is that the SCSI2SD card that I’m using with the VAXes always throws an error on boot. I can later issue boot dka0 from the system monitor, but this error prevents the VAX from auto-booting. ?? 001 10 SCSI 0048 "
<geist> i have never tossed any of it cause it comes in handy
<geist> aaaaah yes i never got mine to auto boot too
<kazinsal> ahhhh mm
<GeDaMo> Is that a Vax specific error or something related to SCSI?
<kazinsal> it'd be nice if there was a manual for this because I would love to figure out what exactly 0048 even *means*
<GeDaMo> This may make searching difficult :P https://www.codesrc.com/mediawiki/index.php/SCSI2SD
<bslsk05> ​www.codesrc.com: SCSI2SD - code/src wiki
<kazinsal> ooookay, I may have found something. 001 is the FRU code for the SOC, 10 is the device ID, 0048d/0030h is "SCSI Data Transfer Test, Non-DMA/Synchronous Miscompare"
toulene has quit [Read error: Connection reset by peer]
toulene has joined #osdev
toulene has quit [Read error: Connection reset by peer]
toulene has joined #osdev
C-Man has quit [Ping timeout: 240 seconds]
mniip has quit [Ping timeout: 606 seconds]
[itchyjunk] has quit [Read error: Connection reset by peer]
Burgundy has joined #osdev
mniip has joined #osdev
ElectronApps has joined #osdev
bauen1 has quit [Ping timeout: 256 seconds]
lkurusa has joined #osdev
the_lanetly_052 has joined #osdev
ElectronApps has quit [Remote host closed the connection]
lkurusa has quit [Quit: I probably fell asleep (or went out). Who will ever know.]
wand_ has joined #osdev
wand has quit [Ping timeout: 240 seconds]
C-Man has joined #osdev
mahmutov_ has quit [Ping timeout: 252 seconds]
Burgundy has quit [Ping timeout: 252 seconds]
pretty_dumm_guy has joined #osdev
X-Scale` has joined #osdev
X-Scale has quit [Ping timeout: 272 seconds]
X-Scale` is now known as X-Scale
gog has joined #osdev
bauen1 has joined #osdev
ElectronApps has joined #osdev
nanovad has quit [Read error: Connection reset by peer]
nanovad has joined #osdev
gog has quit [Quit: byee]
wootehfoot has joined #osdev
Oli has joined #osdev
srjek has joined #osdev
mahmutov_ has joined #osdev
<mrvn> Don't you hate it when you edit an answere on stackoverflow and 1 second before you post the question gets closed?
dormito has joined #osdev
Scripted has joined #osdev
<Scripted> hello
<Mutabah> hello.
<Scripted> mrvn: Memory map is successfully passed
<Scripted> it works now
<bslsk05> ​paste.pics: Screenshot, 2022-03-13 17:21:23 - Paste.Pics
<zid> what was your issue with your uint32_t magic stuff in the end?
the_lanetly_052 has quit [Ping timeout: 252 seconds]
<mrvn> zid: compared with the wrong define.
<Scripted> zid: I suppose, but at the end it was just the lack of concentration
<zid> what
<mrvn> the type was wrong too. so 2 bugs.
<Scripted> I couldn't concentrate properly yesterday
<zid> I asked what you changed to make your code wrong
<zid> correct
<Scripted> so yes, it was the uint32_t magic num as well as the wrong define
<zid> okay so I guessed the latter bit sort of, but what's wrong with the uint32_t magic?
<Scripted> now I'm trying to figure out how I can use this memory map
<zid> this is like pulling teeth
<mrvn> zid: multiboot has 2 32bit constants. One for the magic and one a header tag.
<mrvn> zid: So instead of 'if (magic == FOO)' he has 'if (magic == BAR)'.
<zid> Yes you don't need to spend 6 lines what "the wrong constant" means mrvn
<mrvn> and the print() always showed BAR
<mrvn> sorry, sounded like you didn't get that part
<zid> He said it was "uint32_t magic, and the wrong constant", I said I guessed the latter part already, which is why I asked him at the time what that constant was and where he got it
<zid> but I don't understand what he means by the former still
<Scripted> zid: just look at the github logs
<zid> it wasn't on github
<bslsk05> ​github.com: GitHub - ScriptedDeveloper/CrazeOS at testing
<zid> you were using pastebin.com and we asked you to use github
<Scripted> it is
<Scripted> later I put it on a testing brnach
<Scripted> *branch
<Scripted> so yes, it is on github
<zid> I said wasn't, past tense.
<Scripted> it was on github
<zid> It was not linked, we even asked for the link and it was not given.
<Scripted> ..
<Scripted> I linked it multiple times
<zid> are you confusing me for someone else? I was only here for the bit I was here for
<zid> not for the bits I wasn't
<zid> that's why I am asking you what the resolution ultimately was
<Scripted> I don't know when you were here and when not
<zid> Absolutely fine, but I'd rather not be brow beaten for not being telepathic
<Scripted> there are logs tho
<Scripted> so saying I have never linked it to you is not true
<zid> Okay I've resolved the problem on my end, cya
<Scripted> bye
<mrvn> Except there is no contract saing unique_ptr shall not be nullptr. That's just convention. What if nullptr is perfectly fine and the function will allocated it's own object if none was given? std::option<std::unique_ptr<T>>?
<mrvn> ups
toulene has quit [Read error: Connection reset by peer]
toulene8 has joined #osdev
ElectronApps has quit [Remote host closed the connection]
<mrvn> void foo(int &p);
<mrvn> void bla() { int *i = nullptr; foo(*i);
<mrvn> }
<mrvn> https://godbolt.org/z/KKjq6Wzhe Why doesn't that give a warning?
<bslsk05> ​godbolt.org: Compiler Explorer
wand_ has quit [Remote host closed the connection]
wand has joined #osdev
<GeDaMo> zid: (21:00:46) GeDaMo: scripted: in your kmain you've compared to MULTIBOOT_HEADER_MAGIC but you're printing MULTIBOOT_BOOTLOADER_MAGIC
<zid> yea we covered that twice
<zid> not that he'd printed anything when I was around
<GeDaMo> Ah
bauen1 has quit [Ping timeout: 256 seconds]
bauen1 has joined #osdev
toulene8 has quit [Read error: Connection reset by peer]
toulene has joined #osdev
<mrvn> How do you check a reference for nullptr?
<mrvn> You fail if the compiler eliminates the check. Bonus points for readability.
<mrvn> I want to transfer ownership of a not_null pointer.
<mrvn> ups, ewin
kingoffrance has quit [Ping timeout: 240 seconds]
Burgundy has joined #osdev
<Scripted> How can I get the total memory size via memory map passed by multiboot?
<mrvn> verry carefully
<Scripted> ?
<mrvn> The memory map comes from the BIOS and not the bootloader. Outside of qemu it's nearly always malformed with overlapping regions or regions listed twice. So you have to sanity check it and not just sum up all the usable regions.
<Scripted> I thought I could get the memory map via GRUB
<Scripted> / multiboot
<mrvn> GRUB gets the map from the BIOS and passes it along. It doesn't fix a bad map. Start with qemu. Print out the region and draw it on a piece of paper and think how to compute the size. Then think of all the ways the map could be bad.
<Scripted> Ok
CoffeeMuffin has left #osdev [WeeChat 2.8]
heat has joined #osdev
[itchyjunk] has joined #osdev
Scripted has quit [Quit: WeeChat 3.4]