Search logs:

channel logs for 2004 - 2010 are archived at ·· can't be searched

#osdev2 = #osdev @ Libera from 23may2021 to present

#osdev @ OPN/FreeNode from 3apr2001 to 23may2021

all other channels are on OPN/FreeNode from 2004 to present

Thursday, 20 January 2022

00:27:00 <Lugar> hello
00:28:00 <Lugar> i tested positive for covid so now i get to stay home and code more :]
00:29:00 <Ryanel> Howdy Lugar. When I got covid a few weeks back, that's exactly what I did too. It was surprisingly productive. Covid sucks though, so do feel better!
00:30:00 <Lugar> thanks
00:30:00 <Lugar> since i have over a week im gonna move my os to uefi
00:30:00 <klys> you might learn a bit from when I was trying to port acpica to lk
00:31:00 <klys> I'll link my tarball from then
00:34:00 <heat> acpica is pretty simple to port
00:34:00 <klys>
00:34:00 <heat> implement the os interface and try to run it
00:34:00 <heat> failed? do it again
00:34:00 <klys> I got it to where it compiled all the acpica binaries
00:35:00 <klys> nothing runs yet
00:35:00 <heat> why do you want the binaries?
00:35:00 <heat> you just need the kernel resident subsystem
00:35:00 <klys> oh I was doing a full acpica port
00:41:00 <klys> and it shouldn't have been difficult, I just got a job and have been busy ever since
00:43:00 <klys> note: my acpica version was released under the gpl,
00:43:00 <bslsk05> ​ Version 20200326 | The ACPI Component Architecture Project
00:49:00 <heat> no, it's dual licensed
00:49:00 <heat> or triple licensed
00:49:00 <heat> something like that
00:49:00 <heat> you can pretty much use it everywhere
00:51:00 <heat> like every big OS out there(mac, freebsd, linux, fuchsia, etc) uses it
00:51:00 <klys> all I mean to point out is that mine is still triple licensed
00:51:00 <heat> the only one that doesn't is windows I believe
00:54:00 <klys> 16:30:30< Zero3K@freenode> how do I split files from one commit to another?
00:56:00 <geist> well, if they're here i might be able to help them
00:57:00 <geist> forgot that there might be another channel still on freenode
00:57:00 <geist> that's still around?
00:57:00 <klys> yeah
00:57:00 <geist> any activity?
00:57:00 <klys> yeah: the above
00:57:00 <geist> hah that *is* the sum total of activity?
00:58:00 <klys> crystalmath was on last night
00:58:00 <kazinsal> ha
00:58:00 <heat> i think we won
00:58:00 <klys> he was answering web-85 on something with x86-64 asm
00:59:00 <klys> your friendly neighborhood spammer was on last week
01:00:00 <klys> somebody poked in another x86 asm question on the 12th but left too quickly
01:01:00 <klys> and njugush_ said hi on the 30th, those are all my scrollback
01:02:00 <geist> while i dont particularly want to think of it as a competition or whatnot, i'm glad to see we didn't bifurcate the community too much with that
01:04:00 <kazinsal> yeah we all moved here pretty quickly
01:04:00 <heat> yo thank god the spammer still goes to freenode
01:05:00 <kazinsal> he's showed up here a few times but I bet no one on the freenode channel has op
01:05:00 <kazinsal> so no one's around there to ban him
01:05:00 <heat> maybe the emperor himself
01:14:00 <joe9> Does this instruction work in amd64? . I can get the JMP to a label and CALL to a symbol work fine.
01:14:00 <joe9> But, the jmp to absolute value does not.
01:15:00 <joe9> I tried with different segments cs, fs, etc.
01:15:00 <joe9> without any luck.
01:15:00 <joe9> according to this, it should work(?)
01:15:00 <bslsk05> ​ JMP — Jump
01:17:00 <heat> segments don't do a thing on x86_64
01:17:00 <joe9> I get a general protection violation when I try it.
01:17:00 <heat> except gs and fs but those really are special (for TLS)
01:17:00 <joe9> does the jmp absolute address work?
01:18:00 <heat> doesn't jmp QWORD PTR jump to what the address it's pointing to contains?
01:18:00 <joe9> oh. I thought it was the address.
01:18:00 <joe9> not, the address of the address (jump location)
01:19:00 <joe9> REX.W FF /5 JMP m16:64 D Valid N.E. Jump far, absolute indirect, address given in m16:64.
01:19:00 <joe9> heat, I think you are correct. Thanks.
01:20:00 <joe9> it is an indirect address not the absolute immediate
01:20:00 <klys> oh yeah good one picking up on that ptr thingy
01:22:00 <heat_> stupid internet
01:22:00 <heat_> anyway
01:22:00 <heat_> <heat> generally in x86_64 you just do (ATT syntax) mov $addr, %reg; jmp *%reg
01:22:00 <heat_> <heat> or a pushq + ret
01:22:00 <klys> right, > good one picking up on that ptr thingy
01:22:00 <heat> the first one would be like, what, mov reg, addr; jmp reg?
01:23:00 <heat> yeah good to know I can still read a bit of intel syntax ;)
01:28:00 <joe9> yes, mov $addr, %reg; jmp *%reg this works fine.
01:28:00 <joe9> I was trying to figure out why jmp absolute_address would not work.
01:28:00 <joe9> jump relative works fine too.
01:28:00 <joe9> it makes sense now. Thanks.
01:28:00 <junon> For anyone interested, UVB76 is being hijacked by pirates at the moment
01:28:00 <junon> In response to impending Russian invasion
01:28:00 <kazinsal> oh shit
01:28:00 <junon> there's a live stream on youtube if you search for it
01:28:00 <kazinsal> that's awesome
01:29:00 <joe9> what invasion?
01:29:00 <kazinsal> ukraine
01:29:00 <junon> they've been playing nirvana on it and were using the trackers to spell out anti-putin russian strings, trollfaces, Metroid game cover art, and Ukrainian coat-of-arms
01:29:00 <klys> pirates?
01:29:00 <joe9> has it started?
01:29:00 <junon> klys: yeah, RF pirates
01:30:00 <klys> radio frequency?
01:30:00 <junon> joe9: not yet, but looks like it'll happen within the coming week(s)
01:30:00 <klys> I had thought you were talking about a boat for a minute there
01:30:00 <junon> klys: yeah. uvb76 is a well known russian military communications frequency that's been in operation for 30 years or so. It's never had pirates on it until the last few days.
01:31:00 <kazinsal> jesus christ, they're blasting out RHCP over the Buzzer
01:31:00 <kazinsal> this is amazing
01:31:00 <junon> Apparently it was seeing some huge shifts in activity prior to the mobilization of russian resources to the border of ukraine, so someone has hijacked the frequency and used the blotters to spell out a telegram invite link to send music/image requests to
01:32:00 <klys> envision if you will, a radio that communicates digitally, perhaps encrypted, and at a selected rate, changes its frequency.
01:32:00 <CompanionCube>
01:32:00 <bslsk05> ​'UVB-76/The Buzzer (4625Khz) LIVE 2022-01-20 01:32' by The SWL Channel (live)
01:32:00 <junon> this is the closest thing to a modern Max Headroom I think we'll see for a while.
01:32:00 <junon> wanted to share with you all lol
01:33:00 <CompanionCube> good thinng it's not actually part of their dead hand system, eh?
01:33:00 <kazinsal> it's back to buzzing
01:33:00 <klys> the thing I mentioned is how I think most military RF equipment operates.
01:34:00 <junon> it just swept, that's not the buzzer.
01:35:00 <junon> buzzer is low and hits 4 different frequency bands at once, this is interference still.
01:35:00 <junon> back to music haha
01:35:00 <junon> anyway I'm headed back to bed, this has been going on for >48 hours now so I'm sure it'll still be going on in the morning. Night!
01:36:00 <CompanionCube> has it played rasputin yet, i wonder
01:37:00 <junon> oh man, that would be incredible
01:37:00 <kazinsal> this is by far one of the most interesting things to happen on a numbers station frequency in years
01:38:00 <junon> yeah this is intense, especially given the context
01:39:00 * CompanionCube recently randomly learned that there's a taiwanese numbers station
01:40:00 <CompanionCube> ooh, it's playing the final countdown!
01:40:00 <junon> They're playing the final countdown, oh jeez or man
01:40:00 <junon> not a good sign
01:40:00 <junon> :D
01:40:00 <geist> okay enough of this here
01:41:00 <junon> haha sorry geist, I'm off anyway
01:45:00 <heat> joe9, I think x86 doesn't have jmps and calls to absolute addresses like that
01:45:00 <heat> always indirectly through a register
02:41:00 <joe9> heat, ok. thanks.
18:44:00 <joe9> in amd64, when an interrupt/exception without an error code is raised, will a 0 be pushed into the stack for the error code?
18:45:00 <joe9> such as interrupt 6(#UD) or interrupt 7 (#NM)
18:49:00 <zid> things that push, push, things that don't, don't. It's fairly common to put an extra fake push in yourself so they 'all' have an error code.
18:50:00 <zid> 6.15 - Interrupt 6 says "Exception Error Code" "None"
18:51:00 <zid> Whereas something like 10 says "An error code containing... is pushed onto the stack"
18:58:00 <joe9> thanks, that makes sense.
19:00:00 <joe9> zid, so the stack on entering the interrupt handler is: SS, RSP, RFLAGS, CS, RIP, error code (if any), Return PC from the vector table?
19:01:00 <joe9> I am not sure of the Return PC from the vector table.
19:01:00 <joe9> just want to double check if that is on the stack too.
19:01:00 <joe9> the interrupt handler is CALL'ed so I assume that puts a PC on the stack too.
19:05:00 <joe9> figured it out. sorry for the bother.
19:06:00 <zid> You wouldn't get very far without RIP being there
19:06:00 <zid> iretq to.. somewhere!
19:06:00 <joe9> yes, that is true. I was talking about the return PC from the vector table.
19:06:00 <zid> the what
19:07:00 <joe9> if the interrupt handler is a call ..
19:07:00 <joe9> it is system specific.
19:07:00 <zid> pardon
19:07:00 <joe9> please ignore. In this os, the interrupt vector table is a bunch of call's.
19:14:00 <clever> on my main platform of interest, the vector table is an array of entrypoints, and the cpu will push the status and pc registers onto the stack before jumping to one
19:14:00 <clever> all errors are in MMIO space, and i am fully responsible for preserving every other register
19:15:00 <joe9> has the vector table I am working with at the bottom.
19:16:00 <clever> ah, your vector table is an array of opcodes, and it just directly jumps to that tiny slot
19:16:00 <joe9> a slightly modified version of plan9's.
19:17:00 <clever> it is a bit odd, how you have a `byte 0x01` in there, and how they all reference SB
19:17:00 <joe9> that is just the assembler syntax
19:17:00 <joe9> the byte 0x01 is the trap type to identify the interrupt fired
19:17:00 <clever> its a weird one
19:19:00 <clever> for context, this is what my irq handler looks like:
19:19:00 <bslsk05> ​ lk-overlay/interrupt.S at master · librerpi/lk-overlay · GitHub
19:19:00 <zid> I don't see the point in the table at all
19:19:00 <zid> the hw already maintains a table
19:19:00 <clever> and then i fill an array with pointers to that,
19:19:00 <bslsk05> ​ lk-overlay/intc.c at master · librerpi/lk-overlay · GitHub
19:20:00 <joe9> I guess having a single point of entry..
19:21:00 <zid> You'll need unique code to deal with each exception anyway, so you may as well.. point the interrupt there, is my thought
19:21:00 <zid> even if it does duplicate an entire couple of instructions
19:21:00 <clever> my ExceptionHandler macro in interrupt.S is an example of that
19:22:00 <clever> lines 16-44
19:22:00 <clever> its just generating a duplicate block of 4 opcodes for each exception, with a different immediate to load into r0
19:23:00 <clever> but it is also using a branch opcode, to jump to a shared tail, that finishes the setup before moving into C land
19:25:00 <zid> You've crunched all the icache and branch prediction etc anyway by taking an exception at all otherwise I'd be more wary of duplicating all the intros
20:31:00 * wikan waves
20:32:00 * GeDaMo particles
20:32:00 <blockhead> :)
20:35:00 <wikan> :)
20:35:00 <gog> :)
20:37:00 <wikan> i logged in and i am sleepy now :P
20:37:00 <wikan> must drink coffe and tea
20:37:00 <gog> i had a coffee on my walk home. it was delicious
20:39:00 <wikan> how much sugar?
20:41:00 <wikan> i love coffee with pistachio mmmm
20:42:00 <CompanionCube> heh, someone here recently mentioned mainframes, then elsewhere someone mentioned a UNIX port for the 370, apparently was from V6.
20:43:00 <CompanionCube> that's probably contemporary with the other software mentioned here :p
20:43:00 <gog> no sugar
20:48:00 <wikan> I switched to text mode. Love it. Sometimes I use Xserver if I need to ru
20:48:00 <wikan> n firefox
20:48:00 <wikan> it changed my mind.
20:48:00 <wikan> started to read man :D
20:49:00 <wikan> i didn't knew man is so helpful
20:49:00 <wikan> and now I am trying to find out how TTY works.
20:50:00 <wikan> i use tmux and i have no idea how programs prints to frames and fetch correct width and height of tty
20:52:00 <GeDaMo> curses, termcap
20:53:00 <wikan> yea, but how tmux catch output and put to frame
20:54:00 <wikan> tried to find in sources. I read code still.
20:54:00 <wikan> it is one of many question i have about operating systems in general
20:57:00 <GeDaMo> Presumably it starts programs as children and replaces their stdin and stdout
20:59:00 <zid> dup2 and fork is a normal way
20:59:00 <zid> but, to query the terminal you can just speak vt to them
20:59:00 <zid> which is abstracted behind terminfo / termcap if you want
21:01:00 <wikan> hmmm, reading dup man. I have seen "oldfd" in tmux sources. It is good hint
21:02:00 <wikan> oldfd or old-something tty related
21:03:00 <gog> the original file descriptor that you're duplicating
21:03:00 <wikan> but why duplicate?
21:03:00 <wikan> if I run prog2 from prog1 it will print to prog1 tty
21:04:00 <wikan> still can't see how tmux catches output
21:04:00 <zid> you execvpe it or whatever and its stdin and stdout will be connected to your stdin and stdout
21:04:00 <wikan> maybe i am too stupid ;)
21:04:00 <zid> so you just move your stdin and stdout around along with some extra fds to act as your real stdin and stdout blah blah
21:05:00 <zid> just google for a dup2 example I'm sure it'll explain it
21:05:00 <wikan> ok, thanks
21:06:00 <zid> the trick is that fork() preserves the fd set that the parent had
21:06:00 <zid> so you fork() and then the parent and child can communicate over a pipe you made and replaced the child's stdin/stdout with
21:06:00 <zid> and the child then exec's, replacing itself with 'prog2'
21:07:00 <wikan> ok, but what about width and height?
21:07:00 <wikan> tmux has 100x80
21:07:00 <wikan> mc has 50x80 in pane
21:07:00 <zid> [20:52] <GeDaMo> curses, termcap
21:07:00 <zid> [20:59] <zid> but, to query the terminal you can just speak vt to them
21:07:00 <zid> [20:59] <zid> which is abstracted behind terminfo / termcap if you want
21:07:00 <wikan> so, forked child should use termcap/curses,right?
21:08:00 <zid> I don't know what you're trying to do, so I can't answer
21:08:00 <wikan> ok, just trying to udnerstand basics of tty
21:08:00 <wikan> thanks, i got a lot of information
21:09:00 <wikan> i am still to stupid to write my own os
21:09:00 <zid> sounds like you're trying to rewrite POSIX
21:09:00 <GeDaMo> wikan: you can type tput cols and tput lines to get the size of a terminal
21:09:00 <zid> which is.. not the OS level that most of us tend to care about
21:11:00 <zid> I think ##workingset is the channel for POSIX btw
21:11:00 <wikan> GeDaMo, well I know. I was wondering how tmux tricks for example mc to see different tty size ;)
21:11:00 <zid> speak VT to it but badly
21:11:00 <FatalNIX> CompanionCube: maybe you're the one that wants to port all of 386BSD's Makefiles to GNU Make :P Kidding... kidding...
21:11:00 <wikan> zid, well I still wonder what I want to do. Work on my own os, try it, or build linux from scratch
21:12:00 <GeDaMo> tput sends escape codes to the terminal, tmux intercepts those through the replaced stdout
21:12:00 <CompanionCube> FatalNIX: i vaguely recall microsoft shipping a particularly crappy make at one point, inb4 use that
21:12:00 <wikan> GeDaMo: ohhhhhh
21:12:00 <FatalNIX> Lol
21:12:00 <j`ey> wikan: building linux for qemu is pretty easy
21:12:00 <CompanionCube> would it be easier if you used say, bmake from pkgsrc?
21:12:00 <FatalNIX> CompanionCube: all I know is that the makefiles used in this project are super old and the only thing closest enough at all is bmake.
21:13:00 <FatalNIX> tbh if I could port it to modern BSD make I would
21:13:00 <CompanionCube> inb4 still uses a.out executables as well
21:14:00 <FatalNIX> but I'm more familiar with gmake. I think it would take a lot more work to figure out
21:15:00 <wikan> j'ey probably. how do you thing, isit possible without X :)? No matter what I want to do - linux or my own os?
21:15:00 <wikan> i mean - only text mode
21:15:00 <zid> why would you need X to run an assembler?
21:15:00 <wikan> have no idea. just asking.
21:16:00 <zid> nothing's stopping you typing out the entire windows 11 installation DVD in a hex editor over morse code without a computer at all
21:16:00 <zid> (it's just not very fun)
21:16:00 <wikan> i remember, qemu draws bios logo, so probablyit use SDL or something
21:16:00 <j`ey> wikan: yes, building linux w/o X is fine, I do it a lot
21:16:00 <gog> qemu has a text-only mode
21:16:00 <j`ey> wikan: not if you use -nographic
21:16:00 <gog> ^
21:16:00 * gog taps furiously at her programming telegraph
21:17:00 <wikan> will i learn a lot about oses?
21:17:00 <j`ey> making a linux build? not really
21:17:00 <zid> depends if you mean OS by what we mean
21:17:00 <zid> or what non-osdev people mean
21:18:00 <zid> we mean memory allocation, device drivers, process scheduling, etc
21:18:00 <gog> and implementing it very poorly at that
21:18:00 <wikan> good point
21:18:00 <zid> what you appear to mean is 'user programming'
21:18:00 <blockhead> i recall once hearing about an idea for an OS where the entire interface was headphones and a single key for morse code input
21:19:00 <wikan> well when I tried to write my own os, i stopped on hello world kernel. Didn't know what should i do next.
21:19:00 <wikan> I didn't want copy-paste.
21:19:00 <zid> ideas are the annoying hard part
21:19:00 <gog> yes
21:20:00 <zid> That's why I did networking first because you know, that's weird and fun
21:20:00 <gog> and sometimes an idea might depend on a lot of stuff that you don't already have so you either have to copy/paste or start building wheels from scratch
21:20:00 <FatalNIX> if I were to go about building a hobby OS from the ground up I'd probably work on serial IO networking first
21:21:00 <FatalNIX> I mean that's what I've done before, but I'd probably put more effort into it
21:21:00 <gog> i currently have some refactoring to work on
21:22:00 <FatalNIX> once the UART is up and running... you can use a slave computer for persistence and communication
21:22:00 <gog> i've got a technical debt to pay off
21:22:00 <FatalNIX> Buzz lightyear says: Technical Debt! TEchnical Debt Everywhere!!!
21:22:00 <gog> i got virtual memory spaces working but it's a little bit of a mess
21:23:00 <wikan> where you search for knowledle?
21:23:00 <wikan> for example: virtual memory
21:23:00 <gog> reading
21:23:00 <wikan> when I google for something i am getting trash
21:23:00 <gog> the osdev wiki is a good jumping-off point and the forums sometimes have helpful hints
21:23:00 <wikan> to 10 this, best 20 that, etc
21:24:00 <gog> but for the most part you have to have a pretty good idea of how the thing is supposed to work conceptually before being able to really do it
21:24:00 <FatalNIX> It probably sounds really funny saying this, but in the past when I've worked on OS-like projects, see I have an actual Pentium II box that runs FreeDOS, so I would write code on that and run it inside of DOS then port it.
21:25:00 <zid> yes, google is infact trash
21:25:00 <zid> these days
21:25:00 <zid> get better at tricking it
21:25:00 <kingoffrance> ^
21:25:00 <kingoffrance> it helpfully returns what it thinks most ppl like you wanted, or something
21:25:00 <gog> you can do some funky stuff with DOS
21:25:00 <zid> negative keywords and verbatim searches, limit results to 2002, etc :P
21:25:00 <FatalNIX> I just like that on DOS I am in 16 bit mode, and if I want to do 32 bit stuff I can just load it in a DPMI
21:25:00 <wikan> i think my problem is that, i am self... (past time of teach)
21:26:00 <FatalNIX> makes it easy for testing
21:26:00 <gog> like that guy who implemented DOS Long Mode Interface
21:26:00 <FatalNIX> Yes.
21:26:00 <FatalNIX> Who was that?
21:26:00 <gog> uhhhh
21:26:00 <gog> i'd have to check
21:26:00 <FatalNIX> They were talking about it a year or so ago in here I thought
21:27:00 <CompanionCube> search it in the logs?
21:27:00 <gog>
21:27:00 <bslsk05> ​WindowsNT/asm - Assembly Tutorial for DOS (31 forks/166 stargazers)
21:27:00 <gog> michael chourdakis
21:27:00 <FatalNIX> holy shit.
21:27:00 <kingoffrance> *and it assumes everyone is "ppl like you", so popular searches somehow get boosted, because everyone is your peer
21:27:00 <FatalNIX> I am forking this
21:28:00 <wikan> btw, one huge question i have
21:29:00 <wikan> i asked once on #gcc and got private message as reply. Didn't get it.
21:29:00 <wikan> HaikuOS has or had two versions - build on v2 and v4 of compiler
21:30:00 <gog> the one compiled with 2.95 or whatever is meant to be backward-compatible with the C++ ABI of BeOS
21:30:00 <wikan> why both were incompatible? Why apps for v2 couldn't work on v3?
21:30:00 <gog> the C++ ABI changed
21:30:00 * kingoffrance taps at gog teletrams
21:30:00 <kingoffrance> *telegrams
21:31:00 <wikan> so isn't it too rirsky to use gcc if you write your OS?
21:31:00 <gog> not really
21:31:00 * gog listesns carefully to the beeps and boops
21:32:00 <wikan> i always was thinking binary apps will work always if only libs are compatible. But there is ABI thing
21:37:00 <CompanionCube> yeah, stable ABI essentially only matters vis a vis proprietary programs
21:39:00 <wikan> so, btw, if Intel writes its own c compiler they must follow gcc ABI, right?
21:39:00 <j`ey> if they want to be compatbile
21:40:00 <wikan> they want apps compiled with their compiler to work on Linux compiled with gcc
21:40:00 <wikan> ^ in my example :)
21:47:00 <gog> well, it's SysV ABI and it's defined independently of GCC
22:24:00 <geist> zid: it's a bit of a late response but the general strategy nowadays even on vectored systems that aren't embedded to route everything through a single routine on exception. so much so that the new Fred stuff from intel basically does that
22:24:00 <geist> essentially codifies that virtually all big oses just end up doing a secondary dispatch
22:24:00 <geist> and for the most part most risc machines do the same thing (with perhaps optional vectoring, like riscv)
22:25:00 <geist> my guess is it's because as the kernel gets more complicated there usually is more and more stuff to do in the preamble/postamble of most interrupt/exceptio routines anyway, so may as well have a single instance of that
23:03:00 <kazinsal> bizarre question: anyone every fiddled with openwatcom for 16-bit C work? considering using it for an april fools joke OS "release"...
23:03:00 <klange> I think there are some forumgoers who have.
23:03:00 <kazinsal> s/every/ever/
23:04:00 <klange> gcc has also paradoxically gotten a bit better about spitting out 16-bit code
23:04:00 <klange> (but not 8086 code)
23:05:00 <kazinsal> yeah, that's why I was looking at openwatcom. I want to target the PC/XT for fun
23:13:00 <kingoffrance> there's arghhh cough <spits> also ACK
23:13:00 * kingoffrance coughs
23:13:00 * blockhead hands kingoffrance a cough drop
23:14:00 <gog> you've got rona