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
<gog> happy new year yaaay
<blockhead> you must be the uk, give hours to go for me
<gog> same time zone
<blockhead> wow, my typing is so bad ... s/give/five/ and s/be the/be in the/ sorry about that
<blockhead> happy new year anyway :)
<gog> if i was the uk i'd be ashamed of myself tbh
<gog> what a terrible thing to be
<gog> XD
* blockhead is not saying a word
<j`ey> gog: :||
<gog> that's more a dig at the cultural and political institutions, not its people :p
<j`ey> ok ty
<sortie> geist, yeah nickserv groups have been around for many years
dennis95__ has joined #osdev
dennis95_ has quit [Ping timeout: 240 seconds]
dennis95__ has quit [Quit: Leaving]
mahmutov has joined #osdev
immibis has joined #osdev
<geist> til some finnish curse words
<mjg> happy hacking in 2022
<froggey> gog: you can take a dig at the people too, you've got my permission
<gog> i mean there are names in particular that come to mind
<gog> but the statitics show that most people don't really care
<gog> as in they're not actively hateful of us :p
mahmutov has quit [Ping timeout: 260 seconds]
<froggey> yeah, that's true. I've been surprised by how little trouble I've had
<gog> i've had a couple weird things happen but never been hurt
<gog> one time got a little scary but it ended up ok
<blockhead> story?
<gog> not a very exciting one
<froggey> yeah, I've had a few people yell at me, but that's it and it hasn't happened for like a year
bauen1_ has quit [Ping timeout: 240 seconds]
scoobydoo has quit [Read error: Connection timed out]
ElectronApps has joined #osdev
scoobydoo has joined #osdev
gog has quit [Ping timeout: 250 seconds]
sdfgsdfg has quit [Quit: ZzzZ]
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
mctpyt has joined #osdev
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
ElectronApps has quit [Remote host closed the connection]
dude12312414 has quit [Remote host closed the connection]
dude12312414 has joined #osdev
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<friedy10> Happy New Year!
mctpyt has quit [Ping timeout: 256 seconds]
mctpyt has joined #osdev
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
<zid> I've already failed being a vegan in 2022, I got hugnry
<vdamewood> I think I want to build a computer. Maybe I could make an OS for it.
<kazinsal> my new years resolution is to release something
<kazinsal> I look forward to making the same new years resolution again on december 31, 2022
<vdamewood> My new year's resolution is 3072x1920.
<vdamewood> Same as it was last year.
<klys> mine is terribly reduced, 1366x768. am running qubes.
<zid> Mine's 2048x1152
<wleslie> fork(), eh
mctpyt has quit [Ping timeout: 252 seconds]
mctpyt has joined #osdev
ThinkT510 has quit [Quit: WeeChat 3.4]
ThinkT510 has joined #osdev
myon98 has joined #osdev
GeDaMo has joined #osdev
mahmutov has joined #osdev
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
mctpyt has quit [Ping timeout: 256 seconds]
sdfgsdfg has joined #osdev
qfive has joined #osdev
sdfgsdfg has quit [Quit: ZzzZ]
mahmutov has quit [Ping timeout: 245 seconds]
mahmutov has joined #osdev
someonejv has quit [Quit: Client closed]
sdfgsdfg has joined #osdev
mahmutov has quit [Ping timeout: 240 seconds]
bauen1 has joined #osdev
qfive has quit [Ping timeout: 245 seconds]
ElectronApps has joined #osdev
kaph has joined #osdev
someonejv has joined #osdev
qfive has joined #osdev
dennis95 has joined #osdev
pretty_dumm_guy has joined #osdev
wleslie has quit [Ping timeout: 260 seconds]
wleslie has joined #osdev
mahmutov has joined #osdev
sdfgsdfg has quit [Quit: ZzzZ]
gog has joined #osdev
simpl_e has joined #osdev
mctpyt has joined #osdev
wootehfoot has joined #osdev
the_lanetly_052 has quit [Ping timeout: 240 seconds]
scoobydoo has quit [Read error: Connection timed out]
qfive has quit [Remote host closed the connection]
scoobydoo has joined #osdev
ElectronApps has quit [Remote host closed the connection]
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
the_lanetly_052 has joined #osdev
<gog> mew
<g1n> hi gog
* sham1 hands gog a fish
hussein has joined #osdev
hussein is now known as nur
gruetzkopf has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
* gog borðar fisk
the_lanetly_052 has quit [Ping timeout: 256 seconds]
gruetzkopf has joined #osdev
ZetItUp has quit [Ping timeout: 260 seconds]
ZetItUp_ has joined #osdev
biblio has joined #osdev
dude12312414 has joined #osdev
ZetItUp_ is now known as ZetItUp
ZetItUp has quit []
ZetItUp has joined #osdev
dennis95 has quit [Quit: Leaving]
doppler_ is now known as doppler
<Bitweasil> klys, Qubes too? I've started playing with it over this winter break, got it set up on one of my office machines, will see how long I can stand it.
<asymptotically> gog: icelandic? :D
<GeDaMo> What's the Icelandic word for 'Icelandic'? :|
<GeDaMo> Google translate says 'íslenskur'
<zid> snow deutsch
<GeDaMo> Wikipedia says the language is called 'íslenska'
<zid> That looks polish
* blockhead ponders "how long I can stand it" in regards to Qubes
<sham1> Why Qubes
<sham1> If you don't mind me asking
<kingoffrance> good grief
<zid> what are they doing
<klys> bitweasil, yeah I've been meaning to move to xen and this setup I got in november (dell latitude 5580, 32gb ram, 4core) is providing me with the opportunity. qubes isn't the most stable thing, as I've found; so far I've had to recreate sys-net and run xfce4-panel & manually. now I'm looking for something to do with virsh to help me create a vm without the standard storage space setup.
EtherNet has joined #osdev
<klys> also, qubes users beware, you have to install all your software in the template vm, as the other vms have no persistent storage at /root/
<klys> so install your wifi firmware in the template not sys-net for example
Aster has joined #osdev
<Bitweasil> I have recently learned just these lessons, yes. :)
<Bitweasil> (sorry, Pi crashed, my sweatshirt generates a lot of static out here)
<Bitweasil> Like, I literally arc to my chair hard enough to wake computers and freeze them...
<Bitweasil> sham1, mostly because it's aligned with my interests in terms of isolation and better containment of everything being broken.
<Bitweasil> And I do most of my work in VMs anyway, so "standalone VMs" for projects isn't a big deal.
<Bitweasil> It's more of an experiment than a requirement, but I'm trying to get rid of some computers this year and better align what I use and hack on with what I believe ought to be the case. As computers have turned evil, well... :/
<zid> Bitweasil: tape a whole bunch of chewing gum wrappers together and tie them into a ground pin somewhere, ez :p
<Bitweasil> Heh. Yeah.
<Bitweasil> Anyway, I'm wandering out, I think my office is heated up enough.
<Bitweasil> I've been doing some benchmarking and generally heating the place up.
<zid> Thank god for earthed power outlets
<zid> everything touches earth and I touch everything -> gg
<Bitweasil> I... could stand to put my ground rod in deeper. :/
<zid> I don't mind if it's *actually* earthed, but the fact everything is tied in means no voltage
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
pretty_dumm_guy has joined #osdev
<zid> apparently microsoft exchange broke today because microsoft were using BCD in a signed int
<zid> so the year going to 22 overflew 2.1 billion signed int
<GeDaMo> :|
<sham1> Damn it Microsoft
<sham1> I already knew that MS Exchange is evil, but still. Come on man
pretty_dumm_guy has quit [Quit: WeeChat 3.4]
pretty_dumm_guy has joined #osdev
<bslsk05> ​'57ay1zg663981' by [idk] (--:--:--)
Aster has quit [Ping timeout: 260 seconds]
<zid> rubik's cube is hard, every time I learn J perm I forget Y perm and viceisiace civersarsa
<j`ey> zid: ur brain 2 smol
<j`ey> btw J perm and Y perm are the same alg, they just start at different points, and wrap around
<zid> my brain is smol in 3
<zid> my brain is smol in 3D
<gog> asymptotically: já
scoobydoo has quit [Read error: Connection timed out]
<gog> icelandic language would be "íslensku"
<zid> It's much bigger in 2D
<gog> icelandic as an adjective would be "íslenkst"
<gog> i think
scoobydoo has joined #osdev
<zid> what's "disgusting weeb"
<gog> hmmm
<j`ey> 'zid'
Oli has joined #osdev
<zid> You're thinking of GeDaMo j`ey
<GeDaMo> :|
<zid> GeDaMo famous for it
<zid> never shuts up about hololive or anime
<GeDaMo> You're projecting :P
<geist> speaking of weid scandinavian stuff: https://youtu.be/Wof0xPUmW38
<bslsk05> ​'How to open a door - Finnish instructional video from 1979' by Tiikuri (00:01:52)
<geist> they figured it out in the 70s and didn't tell anyone!
<zid> huu to oopen a duur
<j`ey> very informational
<zid> Is step 1 to mutter perkele until it opens itself
<geist> well, cc does tell you whats going on
<gog> this video keeps showing up in my recommendations
<geist> someone linked it on twitter, but yeah the youtube AI picks up on weird shit sometimes
<geist> but i also learned some finnish slang yesterday: tuhannen pillun päreiksi
<geist> too bad i can't actually pronounce it properly
<gog> huh google can't translate it
<sham1> Basically means that something totally breaks
<gog> a thousand ________ shingles
<zid> I don't learn any of the complicated stuff, I just know casual finnish, poro and perkele
sdfgsdfg has joined #osdev
<zid> covers 90% of coversations
<geist> but it has a slangy origin: something to do with disposible shingles you lay down in a sauna under women during their time
<geist> and having something break into a thousand shards of it
<gog> a thousand bloody shingles
<gog> interesting
<sham1> I suppose a literal translation would be "a thousand shingles of a cunt" but that just sounds odd
<geist> how very scandinavian to have slang involving a saunda
<geist> sauna
<zid> I mean, americans have slang involving burgers and firing guns
<zid> it's just how language works
<geist> and trucks
<gog> gonna eat a burger while driving my truck and shooting guns
<geist> and make sure your truck has at least 14 cupholders
<sham1> You jest, but cupholders are very useful
<geist> yah the top gear guys loved ripping on american cars for having too many cupholders
<gog> they have to be enough to hold a 128oz soda
<geist> but... i like cupholders
<GeDaMo> Some cupholders can even read CD ROMs :|
<blockhead> i go afk and come back to ... american cupholders :o
<sham1> They also ripped on Richard being too much of a "wannabe-American"
<blockhead> RMS Richard?
<geist> GeDaMo: oh that reminds me. every time i get in my car i got in 2019 i keep admiring the CD player slot in the radio and think: i should find a CD to put in that
<sham1> blockhead: Hammond
<geist> and i always forget 5 seconds later
<geist> like does it understand MP3s?
<zid> it does
<zid> but maybe only outside of directories
<geist> yah question is is it worth the effort to burn a mp3 cdrom just to test
<blockhead> some cars can read rewriteable cds
<sham1> No reason not to IMO
<zid> It'll probably have an mp3 logo on it
<blockhead> depends on the age of the car
<zid> yea there's no reason anything can't read cd-r
<zid> +r is different
vinleod has joined #osdev
<blockhead> some can only read regular cds
<zid> a -r is a regular cd, it just isn't pressed
<geist> oh sure, but i mean can it read a cdrom with mp3s on it and let you play them
<GeDaMo> A web search for your car and it CD player might provide an answer
<geist> bah. easy mode
<zid> I bet the face plate says mp3 on it
vdamewood has quit [Read error: Connection reset by peer]
<geist> "The system can play ACC/ACC+ v2/MP3/WMA files on CD-R*, CD-RW discs*, USB memory device, and Bluetooth device."
<geist> well that answers it
<gog> i'm guessing it can traverse directories too, even cheapo mp3 players can do that with FAT filesystems
<zid> that one is more random and they tend not to list it on the specs
<geist> that's he real kicker. every cheapo device i've seen that does mp3 playback from cdroms it ends up being a really sad experience
<zid> it's likely though
<GeDaMo> The Original CD-ROM standard limited directories to 8 deep because that was a limitation on VMS
<zid> yea 20000 mp3s doesn't really go well with "your only controls are track forwards and play"
<gog> a cd can't hold 20000 whole songs tho, more like 100-200
<gog> :p
<gog> depending on encoding quality
<geist> i forget if there were any drectory limitations in iso9660
<geist> that might be where the 8 level thing comes from
<gog> 200 if you're still using the same 128Kbps mp3's you downloaded in 2003 from winmx
<zid> 128kbps? pfft
<zid> try 32
<gog> ugh god
<zid> not all mp3s are music, some are people reading the telephone book over a scratchy telephone line
<geist> well, if you're in a car my experience is trying to mega quality isnt really that big of a thing
<geist> however, 32 is bad
<GeDaMo> One place I worked at used a VAX as a PC file server and the PC created deeper directories, when we had to restore from a backup, everything deeper than 8 levels ended up in the root
<gog> i can hear the smeary artifactiness already
<gog> GeDaMo: whoops lmao
<GeDaMo> Yes :/
<geist> GeDaMo: similarly, iirc there's some sort of mention in iso9660 about version numbers, ie ;1 ;2 ;3
<sham1> oh god
<geist> i forget if they were just encoded in the name or some sort of extra field that was used no were but VMS
<zid> osx fses have that too
<zid> and ntfs
<zid> linux is the only mainstream thing that doesn't really do it
<zid> it's part of the name geist
<geist> if it's logically a separate file, then yeah. question is what parses it and strips it out, etc. but that can be an OS level thing
<geist> ie open foo, finds the highest numbered foo and opens it, etc
<zid> cdrom://game.exe;1 etc is what you have to write into the autoexec on a playstation disc
<geist> cute
<sham1> Why is there an exe file on a playstation disc, or are they just using that extension because why not
<zid> it's not an MZ
<zid> but it's still an executable
<sham1> Fair enough
<zid> blame microsoft for stealing .exe as an extension
<geist> lots of non dos/windows oses use .exe as an extension because why not really
<geist> yah definitely predates windows/dos
<geist> and post dates. if you're not going to just sniff the contents then may as well use an extension, and .exe is as good as any
<sham1> Well of course, but for understandable reasons it's nowadays associated mostly with MSWindows
<zid> linux has the opposite problem
<zid> not having extensions on executables is tbh kind of annoying sometimes
<geist> agreed
<sham1> ./prog.prog
<zid> a lot of things (like say, makefiles) really care about extensions
<geist> beos went hog wild with the mime-type attribute and having that make a difference
<gog> yes
<geist> which was kinda neat, but had a similar 'what is this' thing on the command line
<gog> beos was based
<zid> "I want to copy every file ending in .c to this dir" is easy, "I want to copy every file that's executable to this dir" is not
<blockhead> what was it based on?
<sham1> zid: just iterate over every file with `file`, use stat to see if they have the executable bit. ez /s
<gog> it was based, full stop
<sham1> Based? Based on what
<gog> :p
<geist> i can talk about beos all day if anyones interested. was my first job outta college, working at Be
<geist> was a really neat system. totally enjoyed it
<bslsk05> ​web.archive.org: Wayback Machine
<sham1> Opinion on Haiku
<gog> i mean you did write the kernel that formed the basis of haiku :p
<gog> haiku is good
<blockhead> and are there haikus in the comments of the source code?
<geist> yah a lot of that was precisely because i had just finished working at Be (2001) and was eager to osdev on my own baed on what i learned
<sham1> That would get annoying really quickly
<geist> so i wrote a kernel (newos) that was largely based on beos's kernel api
<geist> and then it was a good starting point for openbeos, which later turned into haiku
<gog> haiku is goals
<geist> re: kernel api in beos it was a good combination of posix and extensions. it showd me that you can do most of the basic posix stuff for fairly good compatibility but then put your own additional api on top of it
<geist> i guess OSX is much like that too: posix + a bunch of mach stuff
<sham1> I need to get back to OSDev at some point. I just need a robust implementation of redo (read: my own implementation) and then I can do stuff. I can't deal with the BS of make
scoobydoo has quit [Read error: Connection timed out]
<geist> sham1: yes! you should
<geist> though fighting build systems isn't my cup of tea. i learned to be at peace with gnu make and it has served me well
<GeDaMo> Just put everything in one source file then you don't need make :P
scoobydoo has joined #osdev
<zid> tbh my OS effectively compiles with gcc *.c someflags
<zid> that could be a shell script np
<zid> make just makes rebuilds faster
<geist> i was just thinking i should try another stab at LTO last night
<geist> i have gotten it kinda working on LK but it always fails in some subtle way with this or that
<sham1> What can I say. I strive for some sort of perfection, and in lieu of that, something that is tolerable
<Ameisen> Am I blind and dumb, or is AVX512 the only instruction set on x86 that has a vectorized count-leading-zeros instruction
dude12312414 has quit [Quit: THE RAM IS TOO DAMN HIGH]
<GeDaMo> Looks like it
<Ameisen> that I'm blind and dumb, or it's the only set that has said instruction
<GeDaMo> I see bsf and lzcnt for single values and vplzcnt for av512, nothing else
<geist> wow, it CLZ across all 512?
<geist> like the result is up to 9 bits?
<GeDaMo> No, it's for double or quad words
<geist> oh whew. yeah a CLZ across all the bits would be a pretty epic amount of hardware
<geist> though i guess maybe not. only really log2 more hardware maybe
<GeDaMo> Aren't they split into 128 bit lanes anyway?
<geist> true, or 256 depending
<graphitemaster> CLZ across all 512 bits would be insane
<sham1> One thing I think I'd probably have to do, whenever I come back to try and do OSDev again is forego libgcc, because I'd rather not go through the silly procedure of patching the Makefiles again just to remove -fPIC when doing the multilib with mcmodel=kernel
<graphitemaster> But now I kind of want that :(
<geist> graphitemaster: yah that's what i was thinking
<GeDaMo> Could you combine the results of smaller divisions?
<graphitemaster> Isn't CLZ already like sub-cycle once you factor in multiple in parallel
<gog> it's counting with a shift register and takes up to 1024 cycles
<graphitemaster> Like I'm sure you can actually do 4 64-bit CLZs already
<geist> yeah it depends on how much you want to do in parallel i guess
<geist> you could split it into say 8 bit CLZs and parallel test that the leading bytes are zero and then use a LUT for the leftmost 8 bits that isn't zero etc
<geist> some sort of log2 sort of routine
<graphitemaster> Wow the instructions are defined to fudge CF
<graphitemaster> That kind of kills some parallelism
<graphitemaster> also ZF :|
<graphitemaster> I really didn't think these had any side effects
<geist> ZF they probably just already had the logic for that
<geist> what does CF do in a CLZ in this case?
<geist> top bit set?
<graphitemaster> ZF flag is set to 1 in case of zero output CF is set to 1 if input was zero.
<graphitemaster> I'm looking at LZCNT btw, CLZ maps to that right, or BSR I guess.
<graphitemaster> BSR only sets ZF, not CL
<geist> ah yeah i guess the hardware for that is pretty implicit, but i see what you mean. you're talking about the fact that it all goes to a single eflags
<geist> well, that's a thing anyway all across x86
<graphitemaster> Yeah I'm just saying the parallelism is killed if you have zero input
<geist> actually detecting zero on the way in would be nice. ARM for example doesn't have a thing for that. you generally have to if (!zero) clz(thing)
<graphitemaster> Wouldn't matter anyways because the thing is a flag and that's not accessible in C
<GeDaMo> bsr result is indeterminate if the input is zero
<graphitemaster> Is suppose an intrinsic is possible and yeah BSR does not allow zero input. It's LZCNT that has that behavior.
<geist> sure but i bet the compiler would be smart enough to translate your if (zero) into a CF test after the fact
<GeDaMo> "It should be noted that on processors that do not support LZCNT, the instruction byte encoding is executed as BSR."
<geist> weaksauce
<geist> never understood why it would be that much more expensive to just have had CLZ instructions return 32 or 64 or whatnot if leading is zero
xenos1984 has quit [Read error: Connection reset by peer]
<geist> there must be some general reason why that's not the case
<geist> though i suppose some mathematician may argue that it's technically undefined, therefore the anwer is correct
<clever> vmsb Most significant bit position in Rd[i] = msb(Ra[i]|Rb[i])
<clever> does that sound like the same function as CLZ?
<geist> sounds like CTZ yeah
<clever> vcount Population count R_d[i] = (# of nonzero bits in R_a[i]) + (# of nonzero bits in R_b[i])
<geist> er, wait, no it's CLZ
<geist> 32 - CLZ basically
<clever> the vector core on the rpi has both
<geist> FFS i think is what that's called
<geist> as a side note compilers have prebuilts for all of these, use them
<geist> and lots of them can be converted from one to the other with some maf
<gog> i don't like maths
<clever> i was also thinking, CLZ is needed in softfloat
<clever> because floating point expects only 1 bit of integer, after the bit-shifting
<clever> and you need to detect where to move the floating point after an operation
GeDaMo has quit [Remote host closed the connection]
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
xenos1984 has joined #osdev
<geist> yah, though that's usually pretty intrinsic as part of the fpu alu
<clever> geist: the hw fpu you mean?
<geist> yah
<clever> i was trying to implement soft-float, on the vector core
<clever> thinking that doing 16 float ops in parallel could beat the hw float
<geist> ah i see
<clever> even if it was soft-float
<clever> but the math got to be too complex, and it was already nearing too many opcodes to have a net-gain
x88x88x has quit [Remote host closed the connection]
x88x88x has joined #osdev
<clever> the biggest limitation i ran into, is that the mult opcode is 16bit*16bit->32bit, addition is 32bit with carry, and the float-mult produces 3 numbers, spanning bits 0:31, 16:47, and 32:63, so i need to do a 64bit add, 3 ways, with inputs crossing the 2 32bit halves
<clever> and it just got too complex to work out how to do it in as few opcodes as possible, and i was already on the edge of being slower then non-vectorized hw float
Oli has quit [Quit: leaving]
vinleod is now known as vdamewood
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #osdev
ZombieChicken has joined #osdev
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
pieguy128 has quit [Quit: ZNC 1.8.2 - https://znc.in]
pieguy128 has joined #osdev
scoobydoo has quit [Read error: Connection timed out]
scoobydoo has joined #osdev
ss4 has joined #osdev
wootehfoot has quit [Ping timeout: 240 seconds]
scoobydoo has quit [Read error: Connection timed out]
ss4 has quit [Read error: Connection reset by peer]
scoobydoo has joined #osdev
<sortie> I added a rotated /var/log/init.log to my OS. Such a small little thing but it made me happy. Feels so grown up in a way
<mjg> :)
<clever> sortie: maybe its just stockholm, but i like `journalctl -b -1` and the binary logs
<sortie> The important part is that init is managing the logging
mctpyt has quit [Ping timeout: 250 seconds]
<sortie> There's some fundamental problems with consuming logs with a rotating log system, name race conditions where the data might be gone by the time you read it (or you accidentally opened the wrong log because it got cycled while you where iterating them)
<sortie> Then there's also the problems of ensuring the logs are properly timestamped, including a host, and sent maybe to some other system for permanent safekeeping and auditing
<clever> theres also the reason why the .1 logs often arent compressed, because you can never be sure when the writer switches to the new file
<sortie> Ah great interesting point actually
<clever> so you wait a whole extra rotation period before moving .1 to .2.gz, to give the writer time to realize you renamed his file
sdfgsdfg has quit [Quit: ZzzZ]
<clever> journald solves that problem, by having a central daemon handle both writing and rotation
<clever> so it knows what the writer is doing
<sortie> One alternative solution to making consuming logs safe is not cycling them, but that risks running out of disk space
<clever> journald solves that problem, by just not rotating, but still deleting
<clever> instead of renaming thru a set of names like .1 .2.gz .3.gz, you just have a set of random names
<sortie> In other words: A dedicated solution is needed if you want to consume logs safely. That's why init managing them is fairly important. E.g. you could invoke something where you subscribe to a log, and then you get that stream.
<clever> create new files when the current gets too big
<clever> delete the oldest file when the total gets too big
<clever> system@562ca15a95bf489190ddeef3185a2faf-00000000002012a5-0005c84f7790ee87.journal
<clever> but now you get an unreadable mess like this, which can only be read by the correct tooling
<sortie> Such a subscription has some theoretical issues too: If the subscription is consumed too slowly, too much data might buffer up, and the service will either need to block more incoming log data, drop data sent to the subscriber, or do unbounded buffer growth.
<clever> ive run into similar problems with my custom caching daemon
<clever> currently, it downloads the entire file, and saves it to disk, before sending a single byte to the client
<sortie> But at least such a subscription could simply include a notice in some format that data got lost, rather than a potentially malformed stream trying to read .log. ,log.1, .log.2.gz, etc.
<clever> so time-to-first-byte suffers, and the 2nd request is fast
<clever> but only if the 2nd request occurs after the 1st has fully saved
<sortie> I'm thinking my users will have three reasonable logging choices:
<clever> for journald, each message has an id attached to it, and you have a cursor, that lets you fetch every message after X
<sortie> 1) cycled logs (default because it has bounded disk space so /var/log isn't going to exhaust you) and is generally good enough
<clever> and the api could indicate if X wasnt found when you req more
<sortie> 2) unbounded /var/log logs that aren't cycled (for when you don't want to loose logs and are confident you got enough disk space somehow)
<clever> [root@amd-nixos:~]# journalctl -o json -f | jq .__CURSOR
<clever> "s=c1de972f574743299223fac2153f3b32;i=8c127;b=062c76d5dc7242e592b5146dfcd09d5b;m=1b4e1ef2b9;t=5d48dab116ed9;x=88080037a2b83530"
<sortie> 3) forwarding the logs to some logging service that sends them reliably to some other machine or log sink and makes it someone else's problem
<clever> "s=c1de972f574743299223fac2153f3b32;i=8c128;b=062c76d5dc7242e592b5146dfcd09d5b;m=1b4e2153e4;t=5d48dab13d003;x=a891dcf9812fb126"
<clever> the b= is a uuid that is generated on bootup, and every message from a given "boot" has the same b= value, refered to as _BOOT_ID elsewhere
<clever> the rest, i aint got a clue, lol
<sortie> That's the storage solutions. For consuming logs, tail -F /var/log/foo.log is generally good enough for my users. I'll build a better subscription-based solution at some point so it's reliable and as lossless as possible.
<clever> but that t=, looks like a unix timestamp
<clever> `new Date(0x5d48dab13d003 / 1000)` in JS returns a timestamp of 6 minutes ago
<sortie> “tail -F /var/log/foo.log” is pretty reasonable on my OS actually. Once it notices the file has been replaced, it will still consume the remainder of the old file, and then reopen the new one from the beginning.
<sortie> As long as the log isn't cycling way too fast, it's going to be reliable in practice
<clever> `journalctl -f` can do the same, but yeah, its far more complex to implement
mahmutov has quit [Ping timeout: 252 seconds]
newpy has joined #osdev
<newpy> I just went through this tutorial going over the details from boot: https://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf
<newpy> I'd like to develop some higher level stuff now, wondering which env/tutorials people recommend
<newpy> I was using bochs
<gog> i use qemu
<newpy> gog, I should have mentioned I'm on windows (and WSL) for now
<newpy> classes require it
<gog> that's fine as long as you can get a compiler that targets i686-elf
<gog> i think clang exists for windows?
<newpy> well I use gcc on WSL with the appropriate flags
<newpy> eg. ld -m elf_i386
xenos1984 has quit [Read error: Connection reset by peer]
<gog> i don't recommend that personally, the compiler for your host might have spec files and libraries it wants or emit symbols that you don't want
<newpy> ah
<newpy> I use freestanding, no-pic, etc
<gog> it works often