<bslsk05>
vdamewood/seirina - Music synthesis code (0 forks/2 stargazers/Apache-2.0)
<fmlatghor>
I love music
<fmlatghor>
when I'm playing bach it feels like I'm writing code
<fmlatghor>
everything falls into the right place
<vdamewood>
I can feed it a text file with letters on it, and the code will spit out Mary Had a Little Lamb played on the sawtooth wave
<fmlatghor>
oh nice
<fmlatghor>
been meaning to get into writing synths and all that stuff. I like messing around with supercollider
<vdamewood>
Though, the file I currently test with is the Final Fantasy Prelude
<vdamewood>
or rather, the first 5 bars of it.
<vdamewood>
In fact, it's writing this code that I'm procrastinating on at this very moment!
wblue has quit [Quit: wblue]
<gorgonical>
I still want an answer to my question about tty printing if anyone's reading the logs
<zid>
What was it
<zid>
<gorgonical> If I'm at the start of the line and hit ^h, should the interpreter send back a "cursor forward" control character to maintain the cursor pos in the tty?
<gorgonical>
Yes
<zid>
isn't ^H backspace
<zid>
that would depend on.. if the cursor needs to move
<gorgonical>
Well on screen over the QEMU serial I have to actually press ^H to send it
<zid>
i.e if I am C:\> then backspace does nothing
<gorgonical>
Backspace doesn't actually send ^H at least with default configuration of screen
<Mutabah>
A fancier terminal would be in raw mode
<zid>
if I am some_very long command_with lots of \n args then ^H can even go back a row
<Mutabah>
and then just do nothing when it sees the `^H`
<zid>
term doesn't care what backspace does *to your program*, it just does what it gets told, afterall
<gorgonical>
But the main gist of my question is that If I send the ^H over screen to the interpreter, the interpreter is responsible for undoing the action my terminal does?
<zid>
it does something entirely different to the cursor when I play nethack :P
<klange>
If you are asking about canonical mode in a tty, backspace when the buffer is empty should do absolutely nothing.
<gorgonical>
I send ^H, screen moves my cursor back, but there's no characters on input, so is my program on the other side supposed to send a "move cursor forward" command to indicate that?
<zid>
the program is what controls the cursor at all times, unless you have echo hardware enabled
<klange>
Why is your screen moving the cursor back in the first place?
<gorgonical>
oh klange I think you just answered the question for me
<gorgonical>
I overlooked that, lol
<zid>
(nethack gunna be sad if you press backspace and it deletes something)
<gorgonical>
I am in fact having the interpreter echo the character back to the console...
<zid>
curses requires hw echo to be disabled at all times
<gorgonical>
So it's echoing the ^H, so yeah lol
<klange>
The tty layer is traditionally responsible for the implementation of echoing inputs, so in canonical mode you can just not if the input doesn't do anything.
<gorgonical>
I implemented that so long ago I forgot that it does that
<klange>
(and for apps that disable canonical mode, they usually often disable echo as well, so they can be in complete control over the process)
<gorgonical>
hmm
<gorgonical>
Is canonical mode more than "line mode" so to speak?
<gorgonical>
Because I don't actually know that much about tty but I did implement a line-oriented input for my interpreter because typos were driving me crazy
<gorgonical>
So I guess I have a non-conforming canonical mode then, because backspace/^H runs off the beginning of the line
<gorgonical>
Wait, is canonical mode on the sending side or receiving side?
<heat>
gorgonical, oh that ^H is cute
<heat>
qemu serial's terminal emulator does not send IIRC ascii 7f (the default tty erase), so you need to override it with stty usually
<zid>
backspace is honstly a fucking mess
<heat>
tty byte processing is done on the receiving side
<gorgonical>
I've acquired mostly the muscle memory to ^H so it's fine
<gorgonical>
heat: that's good becuase I was about to cry if I learned screen would have done it all for me
<zid>
readline()
<heat>
it *might*
<zid>
is what does it all for you
<heat>
because ncurses, readline, whatever are very smart
<heat>
if you do -serial stdio you'll (probably) have the backspace thing fixed
<gorgonical>
But if I'm doing like screen /dev/pts/2 to connect, I get a raw tty to the VM
<gorgonical>
oh maybe that's why. I'm not just using QEMU's integrated thing
<xelxebar>
Argument registers in the Linux syscall ABI are not at all obvious at first glance. Even i386 and x86-64 are wildly different. Is there a logic to the particular choices? Would be interested in reading up about how these choices were made.
<vdamewood>
Someone rolled a 16-sided die
<Mondenkind>
64-bit kernel is the same as userspace except it uses r10 which in userspace is reserved for plt thunks
<gorgonical>
heat: reason is that's how I feed in my environment, is by having screen paste my word definitions over the simulated serial port, which the interpreter reads and defines, etc.
<zid>
rbx is banned by the cpu, rax is a return, so you're left with rsi, rdi, then rdx, then numbers
<gorgonical>
readbuf core.f, paste . so it just spits them over the line
<Mondenkind>
what about rcx
<Mondenkind>
you idiot
<Mondenkind>
you absolute bufoon
<Mondenkind>
buffoon?
<zid>
I meant rcx not rbx anyway
<vdamewood>
Why not rcx?
<Mondenkind>
then what about rbx
<Ermine>
is 16 die a thing? Seems like it's not platonic
<zid>
rbx *could* be used, but isn't
<vdamewood>
Ermine: It's not platonic, no, but neither is a d10.
<Mondenkind>
vdamewood: syscall uses it
<zid>
rcx is where the old RIP ends up
<zid>
when syscall happens
<vdamewood>
Ermine: Anyway, there's a game called Dungeon Crawl Classics that uses the d16.
<heat>
Mondenkind, rbx is a callee-saved register on the sysv abi
<vdamewood>
It uses all sorts of non-Platonic diece, d5, d7, d14, d16, d24, and d30.
<Mondenkind>
yeah, but that's just kicking the can down the roat
<Mondenkind>
road
<heat>
sure
<zid>
so for your d16, do you use a disgusting bifurcated triangluar prism thing
<zid>
or a football
<Ermine>
I guess they make all sides equally probable somehow
<zid>
Ermine: bifurcated triangular prism
<zid>
it's just a spinning top that can be either way up, and has 8 sides
<zid>
you can do that for any even d
<zid>
it's just fuck ugly
<vdamewood>
zid: Actually, for the other weird ones, they don't do that.
<heat>
xelxebar, but yeah TL;DR the linux x86_64 syscall abi is the x86_64 sysv abi, but with certain registers replaced due to the syscall instruction
<heat>
oh, and FPU registers are preserved across calls
<vdamewood>
the d24 and d30 just use non regular polygons.
<heat>
riscv, arm64 are also similar, they just use a standard calling convention
<zid>
so you're a football not a disgusting spinning toy person vdamewood?
<vdamewood>
If it's hungarian, should it be shp_gomboc ?
<zid>
wat
<zid>
oh
<vdamewood>
I didn't quite part your hair with that joke, did I?
<gorgonical>
klange: I haven't but I will tonight
<gorgonical>
thank you
<klange>
I want to avoid saying things that imply this is the only right way to do it, but if you want to take the traditional approach that things like POSIX expect, TTY Demystified as a great resources for understanding how it all pieces together.
<klange>
is a great resource*
<klange>
bleh
heat has quit [Ping timeout: 245 seconds]
<gorgonical>
vdamewood: that was an incredible pun
<vdamewood>
gorgonical /me bows
netbsduser has quit [Ping timeout: 258 seconds]
ornx has quit [Quit: WeeChat 3.8]
<geist>
klange: hmm that does look like a great read
gog has quit [Ping timeout: 260 seconds]
<zid>
oh gog just quit, what a quitter, I had a pic
mhall has quit [Quit: Connection closed for inactivity]
troseman has quit [Quit: troseman]
vdamewood has quit [Quit: Life beckons]
melonai has quit [Ping timeout: 260 seconds]
Valeria22 has quit [Quit: Konversation terminated!]
[itchyjunk] has quit [Read error: Connection reset by peer]
melonai has joined #osdev
elderK has quit [Quit: Connection closed for inactivity]
bradd has joined #osdev
bradd has quit [Remote host closed the connection]
bradd has joined #osdev
Burgundy has joined #osdev
bgs has joined #osdev
elastic_dog has quit [Ping timeout: 258 seconds]
xvmt has quit [Read error: Connection reset by peer]
xvmt has joined #osdev
elastic_dog has joined #osdev
jijibao has joined #osdev
<zid>
damnit, sick skip failed
<zid>
failed I'd go to bed and wake up feeling better
<zid>
I woke up from hurting
<zid>
figured*
jijibao has quit [Quit: Client closed]
jijibao has joined #osdev
jijibao has quit [Quit: Client closed]
jijibao has joined #osdev
danilogondolfo has joined #osdev
jijibao has quit [Killed (ozone (No Spam))]
benlyn has joined #osdev
mhall has joined #osdev
remexre has quit [Read error: Connection reset by peer]
remexre has joined #osdev
kpel has joined #osdev
Left_Turn has joined #osdev
Jari-- has joined #osdev
Hammdist has joined #osdev
nyah has joined #osdev
GeDaMo has joined #osdev
gog has joined #osdev
kpel has left #osdev [Leaving]
flom84 has joined #osdev
flom84 has quit [Quit: Leaving]
flom84 has joined #osdev
gabi-250 has quit [Remote host closed the connection]
gabi-250 has joined #osdev
<mcrod>
hi
<nikolar>
Hello
<gog>
hi
orccoin has joined #osdev
[itchyjunk] has joined #osdev
MiningMarsh has joined #osdev
leon_on9527 has joined #osdev
<mcrod>
gog may I pet you
<gog>
yes
<Ermine>
gog: may I pet you as well
<gog>
yes
netbsduser has joined #osdev
<ZipCPU>
I'm struggling with a bit of a question: How many features does a computer program running on bare hardware need to have in order to be called an "operating system"? Is it enough if it can time share a fixed set of tasks?
<gog>
it doesn't even really need to time share
<gog>
it can be completely synchronous
<ZipCPU>
Then ... what is the minimum requirement to be called an O/S?
<Jari-->
noun the low-level software that supports a computer's basic functions, such as scheduling tasks and controlling peripherals.
<Jari-->
ZipCPU MS-DOS used to be called a disk driver :)
<ZipCPU>
"low-level" requires an upper level too, doesn't it?
<Jari-->
still an OS
<Jari-->
ZipCPU CP/M like OS is easiest to make, but you might want some features from the present
<ZipCPU>
Is multitasking a requirement of an O/S? Or does the O/S just need to be a software interface layer to access the peripherals?
<Jari-->
ZipCPU nopes, i.e. CP/M is singletasking
<ZipCPU>
Can an O/S therefore be no more than a software library for accessing peripherals?
<Jari-->
ZipCPU well, as long as it boots up, I would say
<Jari-->
you can run it from an USB stick i.e. nowadays
<ZipCPU>
I mean ... If I port newlib to a h/w architecture, and support nothing more than stdio over a serial port, does that count as an "O/S"?
<ZipCPU>
As background, I'm a CPU author--see https://zipcpu.com/about/zipcpu.html Most of my "software" is loaded over serial port over custom designed, FPGA-based hardware. It may later be loaded into a flash (i.e. ROM) for starting automatically.
<bslsk05>
zipcpu.com: About the ZipCPU
<ZipCPU>
My question is sort of a ... when can I say that the software I've built to run on this device constitutes an "Operating System"?
<ZipCPU>
So ... I can access a serial port via newlib. I have access to SD-Cards recently via another project I've built. SD Cards require device drivers --- but when does it all become an "O/S"?