channel logs for 2004 - 2010 are archived at http://tunes.org/~nef/logs/old/ ·· 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
http://bespin.org/~qz/search/?view=1&c=osdev&y=18&m=7&d=14
00:00:00 --- log: started osdev/18.07.14
00:00:44 --- quit: Lowl3v3l (Ping timeout: 244 seconds)
00:03:20 --- join: booyah (~bb@193.25.1.157) joined #osdev
00:04:01 --- join: nwm (~nwm@d162-156-46-158.bchsia.telus.net) joined #osdev
00:07:05 --- join: angel0xff (~zzz@158-58-227-127.sf.ddns.bulsat.com) joined #osdev
00:08:34 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
00:09:57 --- quit: froggey (Ping timeout: 240 seconds)
00:10:03 --- join: allight_ (allight@nat/google/x-eurvtjbzwghpefew) joined #osdev
00:11:33 --- quit: trout (Ping timeout: 276 seconds)
00:12:13 --- quit: allight__ (Ping timeout: 240 seconds)
00:14:09 --- quit: glfernando (Ping timeout: 276 seconds)
00:17:02 --- join: froggey (~froggey@unaffiliated/froggey) joined #osdev
00:26:26 --- join: glfernando (glfernando@nat/google/x-imiijibgigasfzml) joined #osdev
00:27:36 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-207-103-244.002.207.pools.vodafone-ip.de) joined #osdev
00:39:07 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
00:42:08 --- quit: Lowl3v3l (Ping timeout: 264 seconds)
00:42:45 --- quit: variable (Ping timeout: 276 seconds)
00:49:18 --- quit: zeus1 (Ping timeout: 244 seconds)
00:56:22 --- join: Lowl3v3l (~Lowl3v3l@dslb-090-186-057-087.090.186.pools.vodafone-ip.de) joined #osdev
00:57:05 --- join: absolute123 (~vodka@185.192.189.222) joined #osdev
00:57:49 --- quit: AIOP (Ping timeout: 252 seconds)
01:01:09 --- join: Kimundi__ (~Kimundi@i577A9EAC.versanet.de) joined #osdev
01:02:15 <absolute123> i had some connection troubles, i posted more yestirday, i do have couple of free days to come
01:07:56 --- join: NightBlade (~user@ip-173-247-149-50.user.start.ca) joined #osdev
01:08:30 <NightBlade> 'lo
01:10:16 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
01:12:46 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
01:13:23 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-233-234.002.203.pools.vodafone-ip.de) joined #osdev
01:13:36 <Mutabah> Hello NightBlade
01:13:57 --- quit: trout (Ping timeout: 276 seconds)
01:14:12 --- join: asymptotically (~asymptoti@gateway/tor-sasl/asymptotically) joined #osdev
01:15:23 --- quit: elevated (Ping timeout: 250 seconds)
01:19:55 --- quit: NightBlade (Ping timeout: 264 seconds)
01:20:15 --- quit: Lowl3v3l (Ping timeout: 256 seconds)
01:29:25 --- join: elevated (~elevated@gateway/tor-sasl/elevated) joined #osdev
01:31:43 --- join: xerpi (~xerpi@79.red-83-45-197.dynamicip.rima-tde.net) joined #osdev
01:32:41 --- quit: xerpi (Remote host closed the connection)
01:33:04 --- join: xerpi (~xerpi@79.red-83-45-197.dynamicip.rima-tde.net) joined #osdev
01:34:52 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-233-234.002.203.pools.vodafone-ip.de) joined #osdev
01:36:57 --- quit: xenos1984 (Quit: Leaving.)
01:40:23 --- join: sortie (~sortie@static-5-186-55-44.ip.fibianet.dk) joined #osdev
01:41:31 --- quit: [TheGame] (Quit: magic power cut from hell.)
01:41:39 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
01:42:06 --- join: [TheGame] (~while@unaffiliated/awaxx/x-0928682) joined #osdev
01:43:17 --- quit: asymptotically (Remote host closed the connection)
01:43:37 --- join: asymptotically (~asymptoti@gateway/tor-sasl/asymptotically) joined #osdev
01:45:09 --- quit: variable (Ping timeout: 276 seconds)
01:48:53 --- join: Asu (~sdelang@231.18.136.77.rev.sfr.net) joined #osdev
01:53:11 --- join: NightBlade (~user@ip-173-247-149-50.user.start.ca) joined #osdev
01:53:19 <NightBlade> dunno what happened there
01:54:40 <NightBlade> you know, i've been hanging out here for a week now, and this is by far the best community i've ever been a part of
01:55:01 <NightBlade> people are responsive and helpful when you ask a question
01:55:19 <NightBlade> answers are usually very quick too
01:55:49 <NightBlade> theres a lot of knowledgeable people with arcane and obscure pockets of information
01:56:23 <NightBlade> to be honest, i wasn't expecting much from something so niche like an osdev chat
01:56:51 <NightBlade> but i'm happy i chose to come here :)
02:01:23 --- quit: hmmmm (Remote host closed the connection)
02:01:59 --- join: vdamewood (~vdamewood@unaffiliated/vdamewood) joined #osdev
02:02:13 --- join: Burgundy (~yyomony@86.121.70.166) joined #osdev
02:12:29 --- quit: Goplat (Remote host closed the connection)
02:12:46 <Mutabah> :)
02:13:51 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
02:16:42 --- quit: trout (Ping timeout: 265 seconds)
02:17:28 --- join: SopaXorzTaker (~SopaXorzT@unaffiliated/sopaxorztaker) joined #osdev
02:17:31 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
02:24:29 <graphitemaster> we all peeps up in this place fo shizzle
02:24:50 <NightBlade> ^_^
02:26:20 <doug16k> I enabled my virtual allocator debug output, and saw size=0x7ebfdf7f4000 and thought, what? then realized a minute later, oh yeah, there is that much kernel virtual address space free :D
02:26:51 <doug16k> so much it looks invalid!
02:26:54 <NightBlade> yeah, everything above 0x7C is kernel land
02:29:56 <NightBlade> in windows anyway
02:30:17 <NightBlade> linux kernel is highland too, but im not 100% on the boundries
02:31:27 <NightBlade> i have a question: when you make an API call like fread(), does the OS ultimately call an interrupt to perform the read?
02:31:46 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-152-105.002.203.pools.vodafone-ip.de) joined #osdev
02:31:47 <doug16k> x86_64 high half is 0xFFFF8000'00000000 to 0xFFFFFFFF'FFFFFFFF, so it's initially 0x8000'00000000 free (less the kernel code and stuff)
02:31:49 <NightBlade> or an in/out call
02:32:05 <doug16k> NightBlade, interrupt or syscall or something architecture specific
02:32:14 <NightBlade> ok, thats what i thought
02:32:20 <doug16k> assuming it couldn't be serviced from the libc buffer
02:32:30 <NightBlade> just getting started on osdev myself
02:32:34 <NightBlade> always wanted to
02:33:28 <NightBlade> right now my short-term project is a linux like bootable OS on a USB stick that i can do some PC service tasks on
02:33:45 <NightBlade> i know i can just install linux on a USB i've done it
02:33:45 <doug16k> libc might have had enough data buffered to avoid the system call. it's a workaround for dumbass programs that do stuff like reading one byte at a time
02:33:52 <NightBlade> i want to write my own
02:34:23 <doug16k> s/workaround/performance fix/
02:35:19 <NightBlade> so it's like a stream handler for buffered i/o?
02:35:59 <doug16k> fread buffers sometimes yes. it can be forced enabled/disabled, you can give it the buffer address and size, etc
02:36:58 <doug16k> fread is a high level layer. below that is probably read() which would do a syscall
02:38:01 <NightBlade> i have a question about hdd sector sizes, i read that they can only read/write an entire sector at a time, does that mean that a given hdd can only support specific sector sizes, like screen resolutions?
02:38:28 <NightBlade> or is it ultimately up to the OS designer?
02:38:38 <doug16k> it's determined by the drive firmware
02:38:57 <NightBlade> and thats the manufacturer's secret sauce
02:39:00 <doug16k> typically it is one size but it is possible for it to be configurable, such as on NVMe
02:39:26 <NightBlade> is 4096 the default?
02:39:31 <doug16k> the apparent sector size may be an illusion presented to the OS. the physical disk may use a different size
02:39:50 <doug16k> it's almost always 512 bytes. it may not be though
02:40:10 <NightBlade> so the OS just organizes partitions for it's own efficiency?
02:40:13 <doug16k> so much code absolutely everywhere is hardcoded to 512 that the industry is having trouble breaking away from that
02:41:08 <doug16k> the next step up from sectors is clusters. filesystems generally group together multiple sectors into clusters
02:41:36 <doug16k> so if the sector size is 512, and the cluster size is 4096, then every cluster is just 8 consecutive sectors
02:41:53 <NightBlade> ok, so i was thinking of clusters
02:42:10 <doug16k> it scales down the number of units of storage, which saves space when managing free space and things
02:42:25 <doug16k> saves space and increases performance
02:43:03 <doug16k> if the cluster is too big then you start to get space waste because of partially used clusters
02:43:06 <NightBlade> yeah, i wanted to try to design a file system that could pack multiple things into unused space
02:43:50 <NightBlade> i thought about making the ability to divide a block into either a half or quarter\
02:44:06 --- join: ljc (~ljc@unaffiliated/ljc) joined #osdev
02:44:25 <NightBlade> i suppose i wouldn't have to worry about pointers in that case since they are all complete files anyway
02:44:34 <NightBlade> just thought of that
02:44:35 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
02:45:12 <doug16k> that won't be trivial. how do you keep track of which portions are used?
02:45:39 <NightBlade> well i figured i could have an indexed list kind of like a bitmap
02:45:49 <doug16k> where though?
02:45:51 <NightBlade> not a complete one because that would double the size
02:46:00 <NightBlade> well, in the file table
02:46:23 <NightBlade> then it lists blocks that are divided
02:46:36 <NightBlade> then a 1 or 0 for 1/4 or 1/2
02:46:49 <NightBlade> they're evenly divided
02:46:55 <NightBlade> so you know the offset
02:47:23 <NightBlade> i was going to use a hash table or something so i don't have to search the table each time
02:47:53 <doug16k> a 1TB filesystem with 4KB clusters has ~256 million clusters
02:48:12 --- quit: variable (Ping timeout: 276 seconds)
02:48:44 <NightBlade> well to be honest i hadn't thought about larger filesystems yet
02:49:07 <NightBlade> i was kind of designing it for things like old 256MB usb flash drives lol
02:49:26 <doug16k> I'm not saying it can't be done, of course it can. the trick is you have to be able to keep track of which portions of the subdivided cluster are used/free, and you need a way to represent pointing to a piece of a cluster in your metadata
02:49:39 <NightBlade> i'd have to get it working first to see what kind of overhead it introduces
02:49:45 <NightBlade> see if it's even worth it
02:50:14 <NightBlade> well all file lookups would ultimately resolve to a cluster number
02:50:30 <doug16k> it is definitely worthwhile to try to specially handle small files. I don't think it's a great idea to do for the last partial cluster of large files
02:50:41 <NightBlade> but if the file's bigger than a cluster then you don't need to check that cluster
02:50:58 <NightBlade> you just subtract the size until the remainder is less than 1 cluster
02:51:13 <NightBlade> if it's bigger than a half you don't need to check either
02:51:25 <doug16k> the whole file you mean?
02:51:38 <NightBlade> the file or the remainder
02:51:51 <NightBlade> remainder to be read
02:51:55 <doug16k> so what if the program appends to it?
02:52:22 <NightBlade> just clear the partially used chunk and re-index it in the list
02:52:24 <doug16k> seek around updating metadata and read the partial bit and transfer it to a full cluster
02:52:30 <NightBlade> yeah
02:52:58 <doug16k> to save a few KB?
02:53:01 <NightBlade> i just have this nagging feeling that you could save 15-22%+ by doing this
02:53:12 <NightBlade> like on 100-200GB+ systems
02:53:28 <doug16k> you can write a program to look through your machine's actual filesystem and simulate it without implementing a thing
02:53:36 <NightBlade> theres so many small files or partially used clusters
02:53:53 <NightBlade> thats true, it could be calculated easily
02:54:19 <doug16k> space is cheap. doing a flurry of I/Os isn't
02:54:24 --- quit: Mikaku (Quit: server maintenance ...)
02:54:57 <NightBlade> well, if it's optimized to the minimal amount of checks and implemented from the beginning it shouldn't be too bad
02:55:19 <NightBlade> like i was saying about if a file's bigger than a cluster you don't even need to check anything
02:55:31 <doug16k> sounds like a fine idea for small files. I think it is a bad idea for the last bit of a large file though
02:55:47 <NightBlade> what i actually wanted to do
02:55:54 <NightBlade> this was just anciallary
02:56:08 <NightBlade> was implement an in-place recovery system
02:56:28 <NightBlade> firstly i LOVE linux's superblock system
02:56:28 <doug16k> it would be a disk-level malloc. you could allocate small-block pools and subdivide them similar to how malloc does big page allocations and subdivides them
02:56:52 <NightBlade> the way it exponentially distributes copies of it saved my ass once
02:57:02 <NightBlade> i made a mistake when i was formatting a drive
02:57:19 <NightBlade> and accidentally started formatting my ext4 drive to NTFS
02:57:31 <NightBlade> i caught the error JUST in time
02:57:43 <NightBlade> and managed to find 1 superblock that was undamaged
02:57:52 <NightBlade> it was the last one infact
02:58:07 <NightBlade> i configured the mount to use that one and it worked fine
02:58:19 --- join: heat (~heat@sortix/contributor/heat) joined #osdev
02:58:30 <doug16k> that or do backups :)
02:58:37 --- quit: nortega (Quit: Vivu lante, vivu feliĉe!)
02:58:46 <doug16k> your whole drive could keel over dead any moment
02:58:57 <NightBlade> well, it was on my biggest USB stick
02:59:02 <NightBlade> so i didn't have that option
02:59:27 <NightBlade> the drive i'm on is already on it's last legs
02:59:31 --- quit: promach_ (Ping timeout: 260 seconds)
02:59:34 <NightBlade> i can't afford a new one atm
03:00:43 --- quit: Lowl3v3l (Ping timeout: 264 seconds)
03:01:19 <doug16k> I have an external backup drive. my system automatically backs up regularly
03:01:35 --- join: Mikaku (~Mikaku@pdpc/supporter/active/mikaku) joined #osdev
03:01:48 <doug16k> that and I check 5x when I am going to do something destructive
03:02:28 <doug16k> when I was 15 I accidentally deleted a big subtree of stuff at work. I realized and flicked off power
03:02:36 <doug16k> luckily smartdrv hadn't flushed much
03:02:55 <doug16k> lol
03:03:15 <NightBlade> lucky catch
03:03:36 --- join: CrystalMath (~coderain@reactos/developer/theflash) joined #osdev
03:03:45 <doug16k> this was a 486. it didn't zip through things instantly like today
03:04:17 <NightBlade> i've just had so many file errors that having a way to recover a file, even if it took a long time would have been very valuable to me over the years
03:04:19 --- join: promach_ (~promach@bb219-74-174-136.singnet.com.sg) joined #osdev
03:04:47 <NightBlade> bad blocks, indexing errors, error on copy, unknown errors
03:04:49 <doug16k> seriously, get a backup drive. they're pretty cheap
03:05:08 <asymptotically> NightBlade: you could use a service like backblaze or crashplan too, for offsite backups
03:05:41 <doug16k> drives can suddenly die completely. so bad the machine thinks the drive isn't there. try recovering from a drive that doesn't even appear
03:05:57 <NightBlade> i imagine in the future we'll all be adding encrypted comments to cryptocoin blocks
03:06:36 <NightBlade> i thought about doing a test making a filesystem ontop of a smaller cryptocurrency
03:06:38 <asymptotically> space in bitcoin blocks is scarce, it should only be used for settling transactions or maybe timestamping something
03:06:44 <NightBlade> i think it's been done though
03:06:55 <NightBlade> yeah, you'd think so
03:07:19 <NightBlade> except the bitcoin protocol allows for up to 2MB extra data per block
03:07:39 <NightBlade> and by extension most cryptocoin since they're mostly clones
03:08:01 <asymptotically> that doesn't matter, the problem is that every person on the network, even people that want to run a bitcoin node long after you're dead, will have to download your files
03:08:10 <NightBlade> try running strings or file on the block chain and see what comes up :)
03:08:30 <NightBlade> i've heard theres some MPG or MOV files embedded in it
03:08:41 <NightBlade> a couple of JPG's and etc
03:08:44 <NightBlade> never looked myself
03:09:02 <NightBlade> yeah, i know
03:09:09 <NightBlade> thats the problem with it
03:09:11 <rubenwardy> Not really true
03:09:21 <rubenwardy> You tend to work on partial chains
03:09:33 <rubenwardy> Very rarely would you download a whole change
03:09:41 <NightBlade> doesn't mean it's not an interesting thought problem
03:10:30 <NightBlade> also the comment information is optional
03:10:42 <NightBlade> it's not used in factoring the proofs
03:11:40 <NightBlade> somebody correct me if i'm wrong here
03:12:17 <NightBlade> brb coffee
03:14:35 <immibis> asymptotically: the real concerns is that space in bitcoin blocks is expensive. as a person who could be storing files in bitcoin, it wouldn't be my problem if it was scarce but cheap
03:15:11 <NightBlade> hence why i was thinking of smaller cryptocoin
03:15:17 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-195-020.002.203.pools.vodafone-ip.de) joined #osdev
03:15:31 <immibis> then it's cheaper, but less durable. is it worth it?
03:15:34 <NightBlade> since the option is to store a comment upon mining
03:15:42 <NightBlade> as i said it was an experiment
03:16:02 <NightBlade> the only other option is to malform a transaction
03:16:05 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
03:16:38 --- join: svk (~svk@p200300876E101F00D8B0DE4D87BCD50C.dip0.t-ipconnect.de) joined #osdev
03:16:54 <NightBlade> which could be done for basically the cost of a transaction per however much you can store in a transaction
03:17:22 <NightBlade> it also makes the money unspendable
03:18:45 --- join: ZipCPU_ (~ZipCPU@pool-72-73-38-140.clppva.east.verizon.net) joined #osdev
03:19:24 --- quit: trout (Ping timeout: 276 seconds)
03:20:49 --- quit: ZipCPU (Ping timeout: 240 seconds)
03:28:23 --- nick: Kydd_ -> Kydd
03:40:51 --- join: masoudd (~masoudd@5.117.88.15) joined #osdev
03:41:00 --- quit: masoudd (Remote host closed the connection)
03:42:49 --- quit: xerpi (Quit: Leaving)
03:47:05 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
03:49:11 --- quit: myvar (Remote host closed the connection)
03:50:36 --- quit: variable (Ping timeout: 276 seconds)
03:55:18 --- quit: vc-01 (Ping timeout: 244 seconds)
04:01:56 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
04:07:56 --- quit: nwm (Ping timeout: 264 seconds)
04:11:44 --- join: S_Gautam (uid286066@gateway/web/irccloud.com/x-wknqjpugnidbhpet) joined #osdev
04:14:14 --- join: CheckDavid (uid14990@gateway/web/irccloud.com/x-fugszzjqhrgigbxr) joined #osdev
04:17:04 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-195-020.002.203.pools.vodafone-ip.de) joined #osdev
04:18:05 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
04:18:39 --- join: Kimundi_ (~Kimundi@i577A9E65.versanet.de) joined #osdev
04:21:53 --- quit: trout (Ping timeout: 265 seconds)
04:22:10 --- quit: Kimundi__ (Ping timeout: 244 seconds)
04:49:23 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
04:53:00 --- quit: variable (Ping timeout: 276 seconds)
04:53:09 --- join: quc (~quc@host-89-230-167-218.dynamic.mm.pl) joined #osdev
04:56:19 --- quit: doug16k (Ping timeout: 240 seconds)
04:57:06 --- quit: heat (Remote host closed the connection)
04:58:08 --- join: User_ (~User@46.228.182.159) joined #osdev
05:00:58 --- join: vc-01_ (~vc-01@109.123.214.112) joined #osdev
05:01:44 --- quit: User_ (Remote host closed the connection)
05:03:21 --- join: User_ (~User@46.228.182.159) joined #osdev
05:04:06 --- quit: User_ (Remote host closed the connection)
05:17:46 --- join: promach__ (~promach@bb219-74-174-136.singnet.com.sg) joined #osdev
05:17:58 --- quit: islandsparky_ (Ping timeout: 252 seconds)
05:19:31 --- quit: promach_ (Ping timeout: 244 seconds)
05:20:54 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
05:23:45 --- quit: trout (Ping timeout: 265 seconds)
05:29:49 --- quit: absolute123 (Ping timeout: 240 seconds)
05:52:21 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
05:53:14 --- nick: promach__ -> promach_
05:53:39 --- quit: Asu (Remote host closed the connection)
05:55:14 --- join: Asu (~sdelang@231.18.136.77.rev.sfr.net) joined #osdev
05:55:39 --- quit: variable (Ping timeout: 265 seconds)
06:21:19 --- quit: S_Gautam (Quit: Connection closed for inactivity)
06:23:49 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
06:27:15 --- quit: trout (Ping timeout: 276 seconds)
06:27:51 --- join: S_Gautam (uid286066@gateway/web/irccloud.com/x-ycjywpdayesxwqfl) joined #osdev
06:28:06 --- join: drakonis (~drakonis@unaffiliated/drakonis) joined #osdev
06:29:43 --- quit: SopaXorzTaker (Ping timeout: 240 seconds)
06:34:04 --- join: SopaXorzTaker (~SopaXorzT@unaffiliated/sopaxorztaker) joined #osdev
06:37:32 --- quit: Lucretia (Remote host closed the connection)
06:38:57 --- join: marshmallow (~xyz@unaffiliated/marshmallow) joined #osdev
06:45:10 --- quit: graphene (Remote host closed the connection)
06:46:07 --- quit: elevated (Remote host closed the connection)
06:46:59 --- join: graphene (~graphene@46.101.134.251) joined #osdev
06:47:27 --- join: elevated (~elevated@gateway/tor-sasl/elevated) joined #osdev
06:48:27 --- join: SopaXT (~SopaXorzT@unaffiliated/sopaxorztaker) joined #osdev
06:49:12 --- quit: nightmared (Quit: WeeChat 2.1)
06:49:20 --- join: nightmared (~nightmare@unaffiliated/nightmared) joined #osdev
06:49:25 --- quit: SopaXorzTaker (Ping timeout: 244 seconds)
06:51:12 --- join: Lucretia (~Luke@pdpc/supporter/active/lucretia) joined #osdev
06:53:51 --- quit: CheckDavid (Quit: Connection closed for inactivity)
06:55:41 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
06:56:36 --- nick: SopaXT -> SopaXorzTaker
06:58:27 --- quit: variable (Ping timeout: 276 seconds)
07:01:07 --- join: bm371613 (~bartek@2a02:a317:603f:9800:3d21:d4ea:8e13:962a) joined #osdev
07:03:39 --- quit: aalm (Ping timeout: 256 seconds)
07:03:54 --- quit: Lucretia (Quit: Konversation terminated!)
07:04:04 --- quit: antkit (Quit: Connection closed for inactivity)
07:05:00 --- join: Lucretia (~Luke@pdpc/supporter/active/lucretia) joined #osdev
07:10:56 --- quit: apetresc (Ping timeout: 260 seconds)
07:11:30 --- join: Lowl3v3l1 (~Lowl3v3l@dslb-002-203-114-008.002.203.pools.vodafone-ip.de) joined #osdev
07:11:33 --- join: adam4813 (uid52180@gateway/web/irccloud.com/x-aeqifbuevjaliksd) joined #osdev
07:12:03 --- quit: vdamewood (Quit: Textual IRC Client: www.textualapp.com)
07:12:09 --- quit: vc-01_ (Ping timeout: 244 seconds)
07:12:47 --- join: apetresc (~apetresc@CPEbc4dfb720b93-CMbc4dfb720b90.cpe.net.cable.rogers.com) joined #osdev
07:13:28 --- join: vc-01_ (~vc-01@109.123.214.112) joined #osdev
07:13:37 --- join: zeus1 (~zeus@154.224.190.99) joined #osdev
07:14:03 --- quit: Lowl3v3l (Ping timeout: 276 seconds)
07:20:49 --- quit: Lowl3v3l1 (Ping timeout: 240 seconds)
07:24:10 --- join: absolute123 (~vodka@185.192.189.222) joined #osdev
07:24:13 --- nick: [X-Scale] -> X-Scale
07:27:43 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
07:28:26 --- quit: zeus1 (Ping timeout: 260 seconds)
07:30:43 --- quit: trout (Ping timeout: 240 seconds)
07:36:14 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-114-008.002.203.pools.vodafone-ip.de) joined #osdev
07:38:44 --- join: antkit (uid256318@gateway/web/irccloud.com/x-abzmiqwzmqpjilvg) joined #osdev
07:39:00 --- join: JusticeEX (~justiceex@pool-98-113-143-43.nycmny.fios.verizon.net) joined #osdev
07:40:10 --- quit: graphene (Remote host closed the connection)
07:41:44 --- join: graphene (~graphene@46.101.134.251) joined #osdev
07:46:41 --- join: Barrett (~barrett@unaffiliated/barrett) joined #osdev
07:48:42 --- quit: Lowl3v3l (Ping timeout: 268 seconds)
07:58:07 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
08:02:09 --- quit: variable (Ping timeout: 276 seconds)
08:03:08 --- quit: asymptotically (Remote host closed the connection)
08:03:28 --- join: asymptotically (~asymptoti@gateway/tor-sasl/asymptotically) joined #osdev
08:04:09 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-152-200.002.203.pools.vodafone-ip.de) joined #osdev
08:11:54 --- join: zeus1 (~zeus@154.224.190.99) joined #osdev
08:12:09 --- join: freakazoid0223 (~mattc@pool-108-52-244-197.phlapa.fios.verizon.net) joined #osdev
08:12:19 --- join: lordofthekebabs (4eb69ac6@gateway/web/freenode/ip.78.182.154.198) joined #osdev
08:13:09 --- quit: graphene (Remote host closed the connection)
08:14:37 --- join: graphene (~graphene@46.101.134.251) joined #osdev
08:15:33 <lordofthekebabs> hello, I have recently started a long commitment on teaching my self how to build an operating system. This question maybe very easay or stupid but bare in mind that I am clueless with how the computers actually work. How much Gate Logic, Boolean Logic , chipsets like xor, mux, adder, do i have to know ? I just started the `Nand2Tetris` for learning the computer achitecture before I dive deep in modern operating system books
08:15:41 <lordofthekebabs> content but does not go very deep on each subject
08:16:31 <NightBlade> you need to learn some assembly language, and a structured programming language like c/c++
08:17:10 <NightBlade> also you need to know about how the architecture you are developing on functions
08:17:25 <NightBlade> like stack based systems like x86/64
08:17:31 <lordofthekebabs> NigtBlade I am learning about c and soon i will learn about assembly
08:17:47 <lordofthekebabs> but do i necessarily have to know a lot about chip design?
08:17:51 <lordofthekebabs> ggate sets
08:18:08 <lordofthekebabs> do you recommend the Nand2Tetris course ?
08:18:10 <NightBlade> not that stuff specifically, what you need to know are called "truth tables"
08:18:30 <NightBlade> for the or, and, not, xor operators specifically
08:18:43 <lordofthekebabs> NightBlade oh yeah boolean logic
08:18:48 <NightBlade> yes
08:18:52 <lordofthekebabs> do i need to know a lot about them
08:18:57 <NightBlade> not really
08:19:03 <NightBlade> they're pretty simple overall
08:19:12 <lordofthekebabs> can i just stick to writing expressions or do i need to become a wizard and wirte very good truth table functions
08:19:18 <NightBlade> or returns 1 if either bit is 1
08:19:27 <NightBlade> and only returns 1 of both bits are 1
08:19:38 <lordofthekebabs> yeah I got or, and, nand, not
08:19:38 <NightBlade> not makes each bit the opposite
08:19:51 <lordofthekebabs> i just dont know how advanced i should become
08:20:03 <NightBlade> you don't need nand for x86, there's no native operator for it
08:20:29 <NightBlade> well if it's a learning exercise you can approach it from being a beginner, but it will be very difficult
08:20:38 <lordofthekebabs> what do you mean
08:20:52 <NightBlade> when you get a code sample it will take a lot of effort to understand what everything is doing
08:21:09 <lordofthekebabs> okay
08:21:18 <lordofthekebabs> so how can i approachto it as a newbie
08:21:43 <NightBlade> if you haven't played around with a disassembler like olly, ida or something similar then things like memory mapping or page tables and their rules may be confusing
08:22:03 <NightBlade> there's a host of system specific things like DMA channels
08:22:12 <NightBlade> Interrupts
08:22:19 <NightBlade> how control registers work
08:22:29 <NightBlade> different processor modes
08:22:42 <lordofthekebabs> I do not know anyof this other than a GUI, shell and a kernel
08:22:50 <NightBlade> real, protected, and long modes for x86-64
08:22:53 <lordofthekebabs> it is like the first time I started learning web dev
08:23:15 <NightBlade> if you're making your own operating system you need to build everything from scratch
08:23:29 <NightBlade> you can't say import a library
08:23:39 <lordofthekebabs> I didnt know what a css was but learned it over time put js on top of it and learned python, wsgi, postgresql over time putting on top of it
08:23:40 <NightBlade> it's designed to work with a specific os
08:23:50 <lordofthekebabs> yes i want to build everything my own
08:24:00 <lordofthekebabs> I get thats a lot of work but it is fun
08:24:16 <NightBlade> i understand completely
08:24:57 <NightBlade> i'm just getting started in OS dev myself, but i have a healthy c++ and asm background
08:25:10 <lordofthekebabs> so to sum up NightBlade if you are note recommending Nand2Tetris do you reccomend any books for a beginner ?
08:25:26 <palk> lordofthekebabs: I personally think it would be more beneficial for you to take a course on building a C compiler. That should inform you enough about how C translates to machine code, and how the OS interacts with userland, such that you might then know enough to design a functional operating system
08:26:18 <lordofthekebabs> palk hmm alright so you are saying learning compilers is ore benefical than
08:26:31 <lordofthekebabs> learning from the ground up haarware
08:26:34 <lordofthekebabs> hardware
08:26:44 <lordofthekebabs> do you have any reccomendations ?
08:27:06 <lordofthekebabs> I only know the standford course and the dragon book for reference
08:27:19 <palk> learning the "Nand2Tetris" architecture will not at all prepare you for building an x86 OS
08:27:22 <geist> note you dont strictly speaking need to take a course in anything, there's no specialized magic knowledge
08:27:37 <geist> but, you will need to be fairly good with 'low level programming' in a generic sense
08:28:09 <geist> ie, writing code in a low level language like C and assembly and understand what the cpu does at that level
08:28:11 <palk> The dragon book was my introduction to compilers, so that's what I recommend
08:28:17 <lordofthekebabs> yes I always start courses but never finish them they are just introductiory
08:28:26 <geist> you dont need to know any deeper than that
08:28:50 <lordofthekebabs> so no hardware and computer architecture
08:29:02 <lordofthekebabs> I mean it is good knowledge but not very useful when it comes to operating systems
08:29:03 <geist> not necessary, but always helpful
08:29:15 <geist> well. can be useful, but probably not required
08:29:36 <lordofthekebabs> I dont get it so how am i supposed to advance in system programming without courses
08:29:43 <lordofthekebabs> in web i can simply fire up some documentation
08:29:50 <lordofthekebabs> to some hot shot framework
08:29:51 <geist> you just start reading
08:30:01 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
08:30:10 <lordofthekebabs> when it comes to systems there are not many good tutorials, courses
08:30:15 <geist> and tinkering, and using emulators to see what happens
08:30:21 <lordofthekebabs> it seemslike the poeple who do it already know what they are doing
08:30:27 <geist> well, it *is* one of the most difficult computer science projects you can do
08:30:45 <geist> no. i can assure you i learned this stuff all in the era prior to courses or internet
08:30:50 <NightBlade> you'll need a good system emulator like qemu
08:30:54 <palk> right; I was not saying it's required, but from your background of not having any exposure to machine code nor the userland <-> kernel communication, I personally think a C compiler would be the most beneficial thing for you to study, should you choose to study something
08:30:56 --- quit: marshmallow (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:31:05 <geist> you just spend a lot of time reading everything you can. there are lots of resources, including this very channel
08:31:23 <lordofthekebabs> yes i love the wiki.osdev of it
08:31:31 <geist> ie, do not expect to be taught how to write an OS. it doesn't exist
08:31:33 <lordofthekebabs> it is a very angry wiki towards beginners but very resourceful
08:31:42 <lordofthekebabs> no ofcurse
08:32:04 <geist> but you can piece things together from lots of other materials
08:32:16 <lordofthekebabs> I love the divide and conquer methadology I was just unsure weather should I divide the chip designs and comp architecture but you guys answered my questions
08:32:29 <geist> and like most of these large projects, it's really a bunch of separate steps and separate pieces that you tackle one at a time
08:32:29 <lordofthekebabs> thanks
08:32:42 <geist> once you figure out how to break it apart and start to see the steps it is a lot more mangeable
08:33:21 --- quit: trout (Ping timeout: 276 seconds)
08:33:24 <palk> heh, until you realize that you have made a mistake in one, which causes you to have to reimplement all of them
08:33:34 <lordofthekebabs> alright this may come very lazy but
08:33:36 <geist> sure, but if it were easy everyone would do it
08:33:50 <geist> took me a good 2 or 3 years before i had anything really functional
08:33:52 <lordofthekebabs> do you have any mapping of the divided sections of a operating system
08:33:55 <geist> after 2 or 3 false starts
08:34:39 <lordofthekebabs> https://github.com/kamranahmedse/developer-roadmap is there something exissts like this for operating systems
08:34:39 <geist> lordofthekebabs: theres i think a few articles like thaton the wiki
08:34:40 <bslsk05> kamranahmedse/developer-roadmap - Roadmap to becoming a web developer in 2018 (7964 forks/53068 watchers)
08:34:53 <palk> lordofthekebabs: the pieces are fairly well "spelled out" on the wiki; look at the "Introduction" section here: https://wiki.osdev.org/Main_Page
08:34:53 <lordofthekebabs> I ve tried finding something similiar
08:34:55 <bslsk05> wiki.osdev.org: Expanded Main Page - OSDev Wiki
08:35:07 <NightBlade> yeah, i've been doing c++ for almost 19 years, asm for about 6
08:35:30 <lordofthekebabs> palk I have read it it mostly talked and summarized the kernel, GUI and shell
08:35:33 <lordofthekebabs> is that all there is
08:35:38 <lordofthekebabs> 3 main peices ?
08:35:44 <palk> lol no
08:35:46 <lordofthekebabs> with lots of subsections
08:36:02 <NightBlade> you need to understand how hardware works
08:36:13 <palk> GUI and shell are usually not part of the kernel
08:36:16 <geist> of course that's not all there is, but there's no magic page that just tells you step by step
08:36:24 <geist> plus not all OSes are the same. depends on what you want to do
08:36:34 <lordofthekebabs> a tablet OS
08:36:42 <geist> the level of complexity, what you need to do varies immensely based on what you're trying to set out to do
08:36:44 <NightBlade> yeah, take dos for example, no gui there
08:37:01 <NightBlade> a gui is really just an illusion
08:37:13 <geist> keep in mind you will probably fail, but that's okay. you will learn something along the way
08:37:18 <NightBlade> all it does is allow for managing multiple tasks in real time
08:37:20 <palk> lordofthekebabs: this page covers most of the "pieces:" https://wiki.osdev.org/Creating_an_Operating_System
08:37:21 <bslsk05> wiki.osdev.org: Creating an Operating System - OSDev Wiki
08:37:34 <lordofthekebabs> oh yes I just tried using GTK+ 10 mins ago and failed miserably
08:37:42 <lordofthekebabs> but I think i will get the hang of it
08:37:49 <geist> if you give up after 10 minutes you will not make it very far
08:38:01 <absolute123> :)
08:38:10 <lordofthekebabs> no I just got back to the modern C book
08:38:17 <lordofthekebabs> I will try it again once I read it more
08:38:22 <NightBlade> i can give you some pages about writing a boot sector i found extremely helpful
08:38:26 <geist> also remember, nothing is better than doing
08:38:27 <lordofthekebabs> I just wanted to see if it was as easy as tkinter like python
08:38:38 <lordofthekebabs> NightBlade ofcourse thank you
08:38:39 <geist> do and fail and learn
08:38:46 <absolute123> best way to succeed finally is not to give up, and keep the mind open to conduct possible solutions
08:38:48 <absolute123> :D
08:38:54 <geist> right
08:39:24 <lordofthekebabs> alright last question before I study again
08:39:34 <lordofthekebabs> there is nt really alot of jobs out there right?
08:39:56 <lordofthekebabs> I mean im fine with doing web on week and doing osdev at night in the future as my hobby
08:40:40 <palk> there are plenty of jobs
08:40:48 --- nick: ZipCPU_ -> ZipCPU
08:41:07 <lordofthekebabs> for operating system developers ?
08:41:29 <geist> if you're really really good and willing to relocate, yes
08:41:46 <geist> but there are lots more low level embedded programming jobs, which is kind of the same thing
08:41:57 <geist> as in low level, bare metal, or little real time oses on various pieces of hardware
08:42:13 <lordofthekebabs> well Iam willing to relocate but not even remotly good :) than this question is more important when I become good
08:42:28 <NightBlade> https://stackoverflow.com/questions/32508919/how-to-produce-a-minimal-bios-hello-world-boot-sector-with-gcc-that-works-from-a/32509555#32509555
08:42:30 <bslsk05> stackoverflow.com: assembly - How to produce a minimal BIOS hello world boot sector with GCC that works from a USB stick on real hardware? - Stack Overflow
08:42:35 <NightBlade> sorry, took me a minute to find it
08:42:36 <lordofthekebabs> thanks a lot geist NightBlade absolute123 palk
08:42:42 <lordofthekebabs> not a problem
08:42:50 <lordofthekebabs> thanks a lot for taking your time
08:43:05 <lordofthekebabs> have a nice day
08:43:21 <NightBlade> theres also a github page for a minimal OS
08:43:29 <lordofthekebabs> yes I starred it
08:43:36 <lordofthekebabs> ahah nearly starred every os tutorial on github
08:43:52 <lordofthekebabs> from rasbery pi to building real harware
08:44:14 <NightBlade> https://github.com/ghaiklor/ghaiklor-os-gcc
08:44:15 <bslsk05> ghaiklor/ghaiklor-os-gcc - Simple operation system created in educational purposes with asm and C (7 forks/21 watchers)
08:44:36 <NightBlade> i've been studying that one
08:45:33 <NightBlade> all that should be enough to get you studying in the right direction
08:46:10 --- quit: graphene (Remote host closed the connection)
08:46:23 <geist> yah, looks simple and straightforward
08:46:42 <NightBlade> yeah it's pretty clear
08:46:45 <geist> also keep in mind when you first get started it will seem like a big pile of nonsense to get the cpu into the right modes and set up the environment
08:47:10 <geist> it's a big cliff of stuff up front you have to climb. in the long run almost all of that is insignificant in terms of what you'll spend time on
08:47:20 <NightBlade> and when you're making assembly make sure you speficy 16 bit mode when you start
08:47:23 <geist> but it's a necessary hill to climb. it's a lot worse on x86 platforms, lots of crap to do
08:47:42 --- join: graphene (~graphene@46.101.134.251) joined #osdev
08:48:09 <NightBlade> mmm hmm geist is telling the truth, it's never the things you think of that end up costing the most time
08:48:15 <geist> so i's easy to get discouraged, but once you get a lot of tha tworking, in the long run the architecture specific stuff is just a layer of code. kind of like a driver, essentially
08:48:16 <lordofthekebabs> okay god tanks a lot for the resources
08:48:27 <geist> it'll become smaller and smaller in the grand scheme of things
08:48:48 <lordofthekebabs> what do you mean that in the long ron all of them will not be the things I will spend my time on ?
08:48:59 <NightBlade> if you're the right mix of stubborn and curious you'll do fine
08:49:06 <NightBlade> but it is a LONG road
08:49:14 <lordofthekebabs> oh yeah im fine with it
08:49:16 <geist> right, took me years to make too much progress
08:49:27 <geist> but i can tell you it comes faster and faster with practice and experience
08:49:28 <lordofthekebabs> I have no idea why but I really started to love computers
08:49:40 <NightBlade> thats good :)
08:49:43 <lordofthekebabs> I started web dev in the hopes of becoming the next blionnare
08:49:47 <lordofthekebabs> and setting up for life
08:49:49 <geist> at first you dont even know where to start, but over time as you figure more things out, you have more scaffolding to attach new things you learn
08:49:56 <NightBlade> it is indeed fascinating to really get in there
08:50:05 <geist> and then it sort of accellerates until you dont have enough hours in the day to learn all you want
08:50:07 <lordofthekebabs> now even If i was set for life i would just learn about the fun stuff in computers its liek a hobby
08:50:30 <NightBlade> when you're stepping through assembly code watching the registers and memory change it's almost magical
08:50:33 <geist> indeed. this is why i spend a lot of time reading about older machines (70s minicomputers) and other exotic stuff
08:50:37 <geist> fills in evem more voids
08:51:03 <geist> i like to see different ways to do the same thing, i think it gives you a lot of perspective. is it required? nope but it's fun
08:51:15 <palk> geist: I'm surprised you don't spend all your time reading SOSP papers
08:51:20 <NightBlade> hey, it's a great hooby because there's always more to learn/do
08:51:47 <lordofthekebabs> well not beacuse of learning i really love the idea of I can become on of you and invent whatever I want
08:51:48 <NightBlade> a true programmer is never really finished with a piece of code; it just keeps evolving, changing, and improving
08:52:20 <lordofthekebabs> right now i can only invent some small trivial stuff with web but as you said i will get there in time
08:52:22 <geist> palk: nah, i'm much more of a hands on person. i dont read many papers really
08:52:32 <geist> i learn by doing, by reading technical manuals for things that exist
08:52:44 <lordofthekebabs> ahah im pumped thanks I will go code now
08:52:48 <lordofthekebabs> thanks a lot!
08:53:01 <lordofthekebabs> have a nice day
08:53:02 <NightBlade> i find myself revisiting the most bizzare pieces of code i wrote years ago: incorporating them in to projects to solve a problem, changing them into something new, or continuing right where i left off years earlier
08:53:18 <NightBlade> have a good one
08:53:28 <geist> palk: i dont come at programming and osdev from an academic background, i come at it from hack it and go. i tend to think in terms of feelings and intuition. it's sort of hard to explain
08:53:41 <geist> but it's like a spidey sense of what is a good idea and bad
08:53:52 --- quit: lordofthekebabs (Quit: Page closed)
08:54:13 <geist> but i like to do and verify. see that some new thing is an improvement, etc
08:54:25 <NightBlade> i understand, i'm all self taught but i'll still read RFC's, specs, technical papers, books
08:54:42 <geist> right. i read everything i can. even for things that dont directly apply to me
08:54:44 <NightBlade> i operate half on feel, half on how the industry does it
08:54:50 <geist> though lately i have a lot to read
08:55:07 <geist> exactly
08:55:14 <NightBlade> me too, i'm voracious but it's never enough like you said :(
08:56:25 <geist> i did however study computer engineering in college, which was a half mix of electrical engineering and computer science
08:56:37 <NightBlade> thats a good mix imo
08:56:40 <geist> but the CS part of it was generally low level stuff. which was fine for me, what i wanted
08:56:53 <NightBlade> thats what i always wanted...
08:57:15 <palk> you're a TAMU undergrad, right?
08:57:25 <NightBlade> even when i went to college it was supposed to be c/c++ and they switched it to java at the last minute
08:57:58 <NightBlade> i suppose learning java was useful though
08:58:18 <NightBlade> it was dead easy coming from a c++ background though
08:58:28 <lava> the other way round is harder
08:58:36 <NightBlade> i imagine
08:58:45 <geist> palk: who is a tamu undergrad? I went to tamu
08:58:56 <palk> you; that's what I was asking
08:58:59 <geist> yep
08:59:05 <NightBlade> i usually recommend people on the fence to learn either javascript or c
08:59:28 <NightBlade> depending on what they want it for
08:59:32 <NightBlade> or PHP
09:00:50 <NightBlade> then learning java is as easy as learning a new API
09:01:02 <NightBlade> with a few minor exceptions
09:01:03 <lava> i think learning C at university makes more sense
09:01:27 <NightBlade> i think asm/c/CS should all be taught together
09:01:38 <geist> yah sadly tamu was switching to java like everyone else at the time, but CE courses were generally lower level and didn't go that route
09:01:40 <palk> lava: the problem with teaching C is that it takes far longer to get to advanced data structures and algorithms
09:01:44 <geist> dunno what the default intro language is anymore
09:01:48 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
09:01:55 <NightBlade> c# i believe
09:02:04 <NightBlade> or java
09:02:34 <geist> probably depends on what the harware is in the labs, but i'm sure it's mostly at least PC based nowadays. back in my day it was the later days of unix workstations being supplanted with PCs
09:02:39 <geist> so it was half and half (at tamu at least)
09:02:40 <lava> palk: sure, but you don't learn C for exactly the same reasons you would learn python or java or javascript
09:02:47 <geist> and if it was unix then it was a sun workstation
09:03:01 <lava> C and even C++ is very much tied to how the underlying hardware works
09:03:12 <geist> nowadays though i suppose you could easily set up labs with linux on it
09:03:18 <palk> geist: sparc or the weird amd64 sun workstations?
09:03:23 <geist> sparc
09:03:44 <geist> the EE department was all sparc based, and the CS department (at the time) was switching generally from sparc to windows
09:03:48 <geist> note this was 1996 or so
09:04:09 --- quit: variable (Ping timeout: 265 seconds)
09:04:10 <geist> a lot of it was determined by Dell donating lots of computers to the labs
09:04:20 <geist> being that dell was a big contributor in nearby Austin
09:04:39 <geist> also java was all the rage back then, late 90s
09:04:53 <geist> was going to e the big savior that ties everything together. never again will it matter what OS you use!
09:05:15 <NightBlade> hooray!
09:05:15 <lava> :D
09:05:27 <NightBlade> 0)
09:06:22 <palk> lava: I completely agree, but when you only have 8 semesters to convey "all" of computing, skipping some trivialities to get to the later concepts is the only way to cram in the full curriculum
09:07:13 <geist> key is yo udont learn everything at school
09:07:22 <geist> you learn just a framework to attach more knowledge
09:08:06 <geist> years later you'll wonder what you learned at all, especially in CS, since most of the concrete stuff will be obsolete within a few years
09:08:39 <geist> but. you'll hopefully have filled in some basics that you wouldn't have done otherwise, and it gives you some time to think about learning and hopefulyl learn how to learn
09:09:11 <lava> the question how long it will remain feasible to convey "all" of computing in one CS programme
09:10:21 <NightBlade> it already isn't feasable
09:10:23 <lava> with more and more trendy things being added
09:10:34 <NightBlade> they need to pick an approach
09:11:18 <NightBlade> also it depends on weather you take computer science, systems engineering, networking, programmer analyst, etc
09:11:35 --- join: Tazmain (~Tazmain@unaffiliated/tazmain) joined #osdev
09:11:48 <NightBlade> even still they need to pick one or a couple architectures/OS's
09:11:57 <NightBlade> or languages for programmers
09:12:29 <palk> geist: yes, "learning how to learn" is taken as a given in any upper-level education. Less generally, methods for attacking types of problems you are likely to encounter, I personally include in the "all of computing" umbrella.
09:12:43 * geist nods
09:12:55 <NightBlade> depends on if they want to make website designers or application developers
09:13:59 <palk> NightBlade: it's not the job of university educators to train for any particular job role, but rather to convey the concepts and, where practical, the state of the art
09:14:08 <NightBlade> i agree
09:14:31 <NightBlade> i commonly describe college how you outlined above
09:14:42 <NightBlade> i.e. "They teach you how to learn"
09:14:52 <NightBlade> which confuses most people
09:15:00 <NightBlade> "Isn't that what school is?"
09:15:18 <NightBlade> Then i have to explain to them about rigorous wrote
09:16:32 <klys> what's new? what are you guys working on today
09:17:10 <palk> lava: I'm not sure where you're going with that. If my assumption that you are recommending CS curricula be split, I'd ask on what line.
09:17:42 <palk> If my assumption is correct*
09:20:13 --- quit: kasumi-owari (Ping timeout: 240 seconds)
09:22:28 <lava> we have a 6 semester bachelors and a 4 semester masters program... the majority of students takes both
09:22:57 <lava> the bachelors program is mostly the same for all students and the masters program is rather specialized
09:23:22 <lava> i'd suggest already splitting into specializations after 4 semesters
09:23:30 --- join: kasumi-owari (~kasumi-ow@ftth-213-233-237-007.solcon.nl) joined #osdev
09:23:31 <palk> NightBlade: I personally don't care much for the "They teach you how to learn" adage. I find it dubious at best; no curriculum I'm aware of includes "Learning 101." Most that I'm familiar with instead use the "trial by fire" method, which I wouldn't say teaches students generally how to learn, but instead "naturally" selects the students that are capable of learning.
09:24:31 <palk> So to me, "University teaches you how to learn" is akin to saying "Dropping you with an open wound into a tank of sharks teaches you how to swim."
09:25:01 <klys> *cough*
09:25:37 <palk> NightBlade: no offense though; that's just my opinion of it
09:25:59 --- quit: SM0TVI (Read error: Connection reset by peer)
09:26:28 --- quit: Barrett (Quit: I use my brain comu a quindici pistoli.)
09:26:38 <palk> lava: no electives in the bachelors?
09:27:17 --- join: SM0TVI (~sm0tvi@unaffiliated/sm0tvi) joined #osdev
09:27:38 <lava> sure, but not with enough credits
09:28:42 <palk> hm, that's unusual, but with only 6 semesters, probably reasonable
09:29:09 <palk> anyways, have to be on my way; cheers
09:29:14 --- quit: palk ()
09:31:34 <NightBlade> I suppose the trial-by-fire comparison is a fair one
09:32:50 <geist> yah and i actually agree with palk
09:33:00 <geist> i think it teaches you how to learn primarily by forcing you to
09:33:06 <geist> and then measuring the results
09:33:24 <geist> *hopefully* there are some helpful resources along the way, but if not then yes it's kind of a trial-by-fire
09:33:52 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
09:36:13 --- quit: trout (Ping timeout: 240 seconds)
09:40:11 --- quit: ljc (Quit: ayy)
09:41:41 --- join: doug16k (~dougx@172-97-186-251.cpe.distributel.net) joined #osdev
09:50:07 --- quit: tadni (Remote host closed the connection)
09:55:18 --- join: blackandblue (~batdownh@gateway/tor-sasl/blackandblue) joined #osdev
09:59:57 --- join: MarcinWieczorek (~MarcinWie@abbm116.neoplus.adsl.tpnet.pl) joined #osdev
10:01:03 --- join: nortega (~nortega@gateway/tor-sasl/deathsbreed) joined #osdev
10:03:07 --- quit: angel0xff (Ping timeout: 264 seconds)
10:04:58 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
10:05:19 --- quit: zeus1 (Ping timeout: 240 seconds)
10:06:21 --- join: angel0xff (~zzz@158-58-227-127.sf.ddns.bulsat.com) joined #osdev
10:08:15 --- quit: variable (Ping timeout: 276 seconds)
10:10:05 --- quit: DusXMT (Ping timeout: 256 seconds)
10:10:53 --- join: hmmmm (~sdfgsf@pool-72-79-161-139.sctnpa.east.verizon.net) joined #osdev
10:14:14 --- join: DusXMT (~dusxmt@84.245.121.181) joined #osdev
10:20:49 --- join: islandsparky_ (1816e74b@gateway/web/freenode/ip.24.22.231.75) joined #osdev
10:22:28 --- join: palk (~palk@unaffiliated/palk) joined #osdev
10:24:53 <palk> for x86_64, is there a (GCC) function attribute to force it to compile just this function into 32-bit instructions (but still produce a 64-bit object file)
10:25:36 <NightBlade> i'm pretty sure there's a linker argument -m32
10:25:45 <palk> that produces a 32-bit object file
10:25:51 <NightBlade> ok, wasn't sure
10:26:08 <palk> it also applies to the entire translation unit instead of just a single function
10:26:15 <NightBlade> maybe you can use a preprocessor directive?
10:26:23 <palk> that's what I'm asking for
10:26:32 <NightBlade> hmmm, sorry no idea
10:27:12 <NightBlade> in win32 world i think it would be in the #pragma comment() family but's just a guess
10:28:34 <NightBlade> cant you use the -arch=x86 option with the -m64 linker agrument?
10:28:46 <NightBlade> err -arch=i386
10:29:05 <palk> error: CPU you selected does not support x86-64 instruction set
10:29:54 <NightBlade> use --linker-options i think it is, see what the default arch is
10:30:13 <NightBlade> --machine-options thats it
10:30:44 <geist> palk: i seriously doubt it, really
10:31:00 <geist> you're better off splitting that into a separate .c file, though you'll end up dealing with linker headaches
10:31:30 <_mjg_> but what do you need this for?
10:31:35 <geist> in general that path leads to madness (trying to mix 32 and 64bit stuff in a single linker pass
10:31:36 <NightBlade> hmm, how would you handle a jump properly anyway?
10:31:58 <NightBlade> i'd try
10:31:59 --- quit: jjuran (Quit: jjuran)
10:32:04 <geist> and the best way to mitigate it is if you *must* then do it via a .S file compiled as 64bit but then just jam it in 32bit mode and write it yourself
10:34:29 --- join: navidr (uid112413@gateway/web/irccloud.com/x-pnagmhydmpdxwmgg) joined #osdev
10:35:13 --- join: MrOnlineCoder (~MrOnlineC@195.225.231.218) joined #osdev
10:35:49 --- quit: Belxjander (Quit: AmigaOSv4.1.6+//PowerPC native)
10:36:32 --- join: Belxjander (~Belxjande@sourcemage/Mage/Abh-Elementalist) joined #osdev
10:36:45 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
10:37:40 <NightBlade> gcc -b i386 -o main.o -c main.cpp
10:38:20 <NightBlade> then you'll need to force the linker into 64bit
10:38:39 <NightBlade> but that'll give you a 32bit object file
10:39:13 --- quit: trout (Ping timeout: 240 seconds)
10:40:27 <doug16k> NightBlade, you don't need to force the linker to do anything. as long as no relocations are truncated to fit (no code or data access to things linked at an address that is outside 0-4GB range) you can link 32 bit and 64 bit code in the same executable
10:41:24 <doug16k> I have 16 bit, 32 bit, and 64 bit code in my bootloader, in the same executable
10:41:30 --- quit: nortega (Quit: Vivu lante, vivu feliĉe!)
10:41:48 <NightBlade> yeah i knew it was possible
10:42:21 <NightBlade> if you just give ld the 32 bit object it's going to assume it's a 32 bit executable is all I mean
10:42:45 <NightBlade> i'm trying to lookup the -arch argument to specify 64 bit
10:43:00 <doug16k> tell it what executable format to create
10:43:01 <NightBlade> i think it's -arch i386_64
10:43:02 <palk> NightBlade: what do you mean by "handle a jump properly?"
10:43:27 <NightBlade> well, you can only address a 32 bit offset
10:43:35 --- join: MrOnlineCoderX (~MrOnlineC@195.225.231.218) joined #osdev
10:43:36 <NightBlade> a bit more with a far jump
10:43:52 <NightBlade> so unless it links those as 64 bit jumps
10:44:42 <NightBlade> it would have to switch modes before jumps
10:44:55 <doug16k> as long as the 32 bit code is linked to an address that fits in 32 bits, you can switch to 32 bit mode and far call it (to load cs with protected mode selector) and just call it
10:45:14 <NightBlade> well, i was wondering about system calls and the linke
10:45:17 <NightBlade> *like
10:45:29 <NightBlade> kernels are usually in high land
10:45:35 <doug16k> you might not have to switch modes. you can far call with a cs selector that is a compatibility mode selector and the cpu will execute it as 32 bit code but it will really be in long mode
10:45:36 --- quit: elevated (Quit: bye)
10:45:49 <NightBlade> thats what i was thinking
10:46:05 <doug16k> system calls aren't in "the same executable"
10:46:21 --- quit: MrOnlineCoder (Ping timeout: 256 seconds)
10:46:22 <NightBlade> well, i meant api handles really
10:49:28 <palk> NightBlade: well the obvious answer is "ensure that you don't need anything more than a 32-bit offset."
10:49:53 <NightBlade> no doubt
10:52:43 <NightBlade> hmm, couldn't you just use some combination like MOV RAX, CALL RAX to switch?
10:52:58 <NightBlade> or is that no bueno?
10:53:08 <palk> "switch?"
10:53:44 <NightBlade> if you call a 64 bit address from 32 bit mode what happens?
10:54:04 --- quit: antkit (Quit: Connection closed for inactivity)
10:54:06 <doug16k> it doesn't begin to happen, the instruction can't be encoded, so it won't build
10:54:11 <palk> if you force all memory references to go through a register that you "MOV" into first using the imm64 form, that will generally "work" as it avoids the use of rel32 forms
10:54:17 <palk> if that's what you're asking
10:54:25 <doug16k> if you mean "outside 32 bit range" when you say "64 bit address"
10:54:38 <NightBlade> palk: yes exactly
10:54:54 <palk> NightBlade: but as doug16k pointed out, REX.W is not encodable in 32-bit mode
10:55:32 <NightBlade> hmm, so it's like call ESI/SI in 32/16 bit mode?
10:55:40 <NightBlade> it's the same instruction natively?
10:56:17 <svk> there simply is no RAX in 32-bit
10:56:43 <NightBlade> is there a prefix byte like 66 that could be used to change the operand size to a QWORD?
10:56:50 <svk> no
10:56:51 <palk> no
10:56:52 <doug16k> NightBlade, are you asking "how does a 32 bit program make a system call"?
10:57:01 <NightBlade> yeah
10:57:30 <doug16k> same way as any other program. interrupt gates switch from compatibility mode (32 bit mode) to 64 bit mode
10:57:31 <NightBlade> well, that and wondering what happens if you try to make a 64bit call like that
10:57:52 <NightBlade> oh yeah, it's in virtual mem anyway
10:57:54 <doug16k> the IDT has an interrupt gate at that vector and the cpu switches to 64 bit mode and makes the call
10:58:05 <NightBlade> so kernel land is mapped into 32bit anyay
10:58:07 <NightBlade> *anyway
10:58:08 <palk> doug16k: not (usually) the "same way" as the SYSCALL instruction is 64-bit only on some architectures
10:58:20 <doug16k> palk, there's no syscall instruction in a 32 bit program
10:58:26 <palk> exactly
10:58:38 <svk> sysenter/syscall may have different entrypoints depending on where you come from
10:59:15 <doug16k> syscall/sysenter are more annoying to manage during context switch, interrupt vector is commonly used
10:59:23 <doug16k> er/ sysenter/sysexit
11:00:21 <doug16k> the stack to switch to must be loaded into MSRs every context switch, or you need to do paging tricks to make them the same in each thread, then each thread needs its own PML4
11:00:43 <doug16k> so it's better to use interrupt gate for 32 bit programs
11:02:17 <doug16k> syscall doesn't switch stacks, so you can take care of it smoothly in a thread-specific way with a few instructions at the beginning of the syscall handler
11:02:50 <doug16k> interrupt gate will switch to the kernel stack read from TSS RSP0
11:04:51 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
11:05:31 --- quit: absolute123 (Ping timeout: 264 seconds)
11:07:22 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
11:07:37 <svk> My guess would be that sysenter is still faster even if you rewrite the MSR each time
11:10:39 --- quit: variable (Ping timeout: 276 seconds)
11:12:07 --- quit: blackandblue (Remote host closed the connection)
11:12:27 --- join: blackandblue (~batdownh@gateway/tor-sasl/blackandblue) joined #osdev
11:12:39 --- quit: MarcinWieczorek (Ping timeout: 248 seconds)
11:13:55 <geist> having mostly worked with syscall, i'm pretty happy with it
11:14:11 <geist> the main downside is the tricky security bits that you have to be careful about
11:14:30 <palk> I thought you were primarily working with ARM, or have those days passed?
11:14:36 <geist> and it more or less forces you to use gs: , though you probably want to
11:14:36 <NightBlade> trixy hobbitsess
11:15:02 <geist> palk: depends on when you last checked. the last 2 years i've been doing almost exclusively 'big' cpu work. ie x86-64 and arm64
11:15:24 <geist> though i tend to worry about arm64 a bit more, it's frankly just a lot simpler, so there's less balls to juggle
11:15:29 <geist> not a lot to talk about, really
11:15:59 <geist> well, unless people want to hear me blather ad nauseum, of course
11:17:07 --- join: lldd_ (~atrapado@unaffiliated/atrapado) joined #osdev
11:18:33 <svk> syscall is of course the way to go if you're at 64-bit
11:18:49 <svk> too bad they didn't include a swapfs instruction
11:19:26 <geist> re the rewriting the msr thing: there is the fsgsbase stuff, but that's recent
11:19:51 <geist> so you can mitigate the effect of the stall when writing to the MSRs with that. we measured that it was a fairly substantial win in the deep context switch code
11:20:06 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-195-020.002.203.pools.vodafone-ip.de) joined #osdev
11:20:13 <doug16k> geist, for the sysenter stack pointer?
11:20:19 <geist> oh. yeah nmever mind
11:20:22 <geist> fsgsbase is only for those
11:20:49 <geist> yah that seems a bummer, actually
11:20:56 <geist> if it's like most other MSR writes, it's fairly slow
11:21:20 <doug16k> probably explains why linux uses int 0x80. does linux implement sysenter?
11:21:32 <geist> i think for 32bit it does
11:21:51 <geist> almost positive last i cheked it does the usual thing: sysenter for 32bit, syscall for 64bit, int 0x80 for fallback (for 32bit)
11:22:39 <doug16k> yeah I suppose most examples use int 0x80 because it is always supported. sysenter might not exist
11:22:57 <geist> which means of course if it's a 32bit thread it needs to do the MSR stack set, i guess
11:23:21 <geist> yah from user space int 0x80 is much simpler too, since you dont have to do the whole user stack save thing
11:23:29 <geist> so for an example point of view it's almost trivial
11:23:42 <svk> with the advent of the vDSO sysenter is the default in linux
11:23:55 <geist> for 32bit, yes
11:24:28 <svk> Yeah, i hope no one uses sysenter in 64bit
11:25:12 <geist> probably stubbed off. iirc if you set the MSRs to 0 it effectively disables it. i think it has no enable bit like syscall does
11:26:40 <svk> since CS will be NULL, it'll trigger a GP fault
11:26:45 <geist> yah
11:27:20 <geist> i remember because i added code to explicitly zero it out at cpu initialization time, in case it was left in some other state from the previous stage
11:27:50 <svk> huh, maybe i should include that
11:28:06 --- join: jjuran (~jjuran@172.58.184.188) joined #osdev
11:28:12 <geist> always good to double check that everything is as you expect
11:28:19 <geist> even if it never comes up
11:29:12 <svk> Intel is the only vendor to support it in 64-bit mode right? VIA?
11:29:49 --- quit: JusticeEX (Ping timeout: 240 seconds)
11:29:52 <geist> unknown. i have been unable to track down an easy to get VIA 64bit machine
11:30:00 <geist> a core is rumored to exist, but i can't find a mobo with it on it
11:33:46 --- join: Lowl3v3l1 (~Lowl3v3l@dslb-002-203-128-145.002.203.pools.vodafone-ip.de) joined #osdev
11:34:01 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
11:34:54 --- join: spare (~user@unaffiliated/spareproject) joined #osdev
11:35:52 --- quit: spare (Client Quit)
11:36:15 --- join: spare (~user@unaffiliated/spareproject) joined #osdev
11:36:25 <palk> VIA behaves as Intel does
11:37:02 <geist> if you have access to one i'd love a cpuid dump
11:37:48 <palk> I do; I'll get back in touch during the work week
11:38:18 <geist> sure, no hurry
11:38:37 <geist> if it has linux on it, a dump via cpuid -1 and cpuid -r would be lovely
11:39:19 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
11:41:21 <doug16k> palk, do you know if the via chip has good performance? bad?
11:42:30 --- quit: trout (Ping timeout: 276 seconds)
11:43:30 <palk> I'm not knowledgable on what markets they're targeting nor the range of SKUs they offer, if that is what you are asking.
11:44:02 <doug16k> afaik it's intended to be low-power, so it can't be super powerful, but it might have great perf/watt
11:44:28 <palk> The machines I have access to were purchased to study the cryptographic extensions they provide
11:45:41 --- quit: Lowl3v3l1 (Ping timeout: 260 seconds)
11:46:51 <Ameisen> Is there a good way to enforce a structure like having a directory such as /usr/install/bin where applications actually have their binaries, and /usr/bin is hardlinks/symlinks to the binaries?
11:47:13 <Ameisen> Issue being that I've noticed some install scripts/makefiles just presume that they should write to /usr/bin
11:47:32 <Ameisen> though I suppose I could have a system service that detects such writes and 'rectifies' them
11:49:22 --- join: banisterfiend (~banister@ruby/staff/banisterfiend) joined #osdev
11:52:34 --- join: Goplat (~Goplat@reactos/developer/Goplat) joined #osdev
11:59:31 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-233-222.002.203.pools.vodafone-ip.de) joined #osdev
12:06:59 --- quit: bauen1 (Remote host closed the connection)
12:09:31 --- quit: jjuran (Quit: jjuran)
12:10:24 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
12:11:29 --- join: bauen1 (~bauen1@ipbcc18c77.dynamic.kabel-deutschland.de) joined #osdev
12:13:13 --- quit: variable (Ping timeout: 240 seconds)
12:16:47 --- join: amj (amj@linuxfromscratch/translator/amj) joined #osdev
12:20:06 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
12:20:41 --- quit: bauen1 (Ping timeout: 260 seconds)
12:22:38 --- join: bauen1 (~bauen1@ipbcc18c77.dynamic.kabel-deutschland.de) joined #osdev
12:26:11 --- quit: graphene (Read error: Connection reset by peer)
12:26:43 --- quit: SopaXorzTaker (Remote host closed the connection)
12:27:42 --- join: graphene (~graphene@46.101.134.251) joined #osdev
12:28:40 --- quit: X-Scale (Ping timeout: 268 seconds)
12:32:36 --- join: tacco| (~tacco@i59F52C3F.versanet.de) joined #osdev
12:34:32 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-239-254.002.203.pools.vodafone-ip.de) joined #osdev
12:35:18 --- quit: banisterfiend (Quit: My MacBook has gone to sleep. ZZZzzz…)
12:40:56 --- quit: graphene (Remote host closed the connection)
12:41:55 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
12:42:25 --- join: graphene (~graphene@46.101.134.251) joined #osdev
12:43:33 --- quit: navidr (Quit: Connection closed for inactivity)
12:44:45 <Ameisen> does dash not support function arguments
12:44:56 <Ameisen> $1 there just prints the $1 for the script
12:45:02 --- quit: svk (Quit: Leaving)
12:45:33 --- quit: trout (Ping timeout: 276 seconds)
12:50:15 --- quit: manzerbredes (Ping timeout: 268 seconds)
12:52:15 --- join: X-Scale (~ARM@83.223.226.185) joined #osdev
12:54:54 <doug16k> Ameisen, works for me
12:55:55 <doug16k> Ameisen, https://gist.github.com/doug65536/39eb17c8fa83bef8ffa8ecae58ad1070
12:55:56 <bslsk05> gist.github.com: gist:39eb17c8fa83bef8ffa8ecae58ad1070 · GitHub
12:59:10 --- quit: graphene (Remote host closed the connection)
13:00:41 --- join: graphene (~graphene@46.101.134.251) joined #osdev
13:03:14 --- quit: Lowl3v3l (Read error: Connection reset by peer)
13:05:24 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-207-103-241.002.207.pools.vodafone-ip.de) joined #osdev
13:07:17 --- join: JusticeEX (~justiceex@pool-98-113-143-43.nycmny.fios.verizon.net) joined #osdev
13:11:43 --- quit: pie_ (Ping timeout: 240 seconds)
13:11:50 --- quit: Lowl3v3l (Ping timeout: 268 seconds)
13:12:20 --- quit: glauxosdever (Quit: leaving)
13:12:46 --- quit: bluezinc (Quit: ave atque vale)
13:13:13 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
13:16:45 --- quit: variable (Ping timeout: 276 seconds)
13:18:27 --- join: jjuran (~jjuran@c-73-132-80-121.hsd1.md.comcast.net) joined #osdev
13:21:09 --- quit: graphene (Remote host closed the connection)
13:22:34 --- join: graphene (~graphene@46.101.134.251) joined #osdev
13:25:11 --- join: HZun (~HZun@0x3ec72d49.osd.customer.dk.telia.net) joined #osdev
13:26:22 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-190-247.002.203.pools.vodafone-ip.de) joined #osdev
13:28:02 --- quit: bm371613 (Quit: Konversation terminated!)
13:31:11 --- quit: graphene (Remote host closed the connection)
13:32:26 --- quit: froggey (Ping timeout: 260 seconds)
13:32:42 --- join: graphene (~graphene@46.101.134.251) joined #osdev
13:33:55 --- join: pie_ (~pie_@unaffiliated/pie-/x-0787662) joined #osdev
13:34:21 --- join: froggey (~froggey@unaffiliated/froggey) joined #osdev
13:44:43 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
13:46:53 --- quit: Halofreak1990 (Ping timeout: 244 seconds)
13:47:23 --- quit: trout (Ping timeout: 265 seconds)
13:47:34 --- quit: adam4813 (Quit: Connection closed for inactivity)
13:51:26 --- join: Halofreak1990 (~FooBar247@5ED0A537.cm-7-1c.dynamic.ziggo.nl) joined #osdev
13:52:19 --- quit: JenElizabeth (Ping timeout: 240 seconds)
13:53:10 --- quit: graphene (Remote host closed the connection)
13:53:23 --- quit: blackandblue (Quit: Leaving)
13:54:40 --- join: graphene (~graphene@46.101.134.251) joined #osdev
13:57:19 --- quit: angel0xff (Ping timeout: 240 seconds)
14:00:06 <doug16k> isn't it a better idea to map the PICs at 0xF0-0xFF vector range, to make them the lowest priority interrupts? it's strange to map them at 0x20-0x2F, that makes them highest possible priority
14:02:10 <doug16k> I mean in the normal case where you are primarily using LAPIC/MSI/IOAPIC
14:05:11 <klys> does the apic give more than 0x10 irqs?
14:06:05 <doug16k> which apic? local or I/O? depends on what you mean, every vector from 0x20 thru 0xFF can be an IRQ with MSI
14:06:14 <klys> if not, I would say 0x70-0x7f is probably a good idea because of tradition
14:09:09 --- quit: asymptotically (Remote host closed the connection)
14:10:02 <doug16k> when the LAPIC arbitrates interrupts, it selects the lowest vector number set in the interrupt request bitmap and delivers it to the core when the core is in a state where it accepts external interrupts
14:10:34 <doug16k> when it delivers the interrupt to the core, it sets the corresponding bit in the in-service bitmap
14:11:11 <doug16k> the arbitration masks all vecotrs that are a higher vector number than the lowest bit set in the in-service bitmap
14:11:37 <doug16k> higher or equal I believe actually
14:13:11 <doug16k> that makes 0x20 thru 0x2F the absolute highest priority when arbitrating, if the PICs are there
14:13:20 --- quit: graphene (Remote host closed the connection)
14:14:08 <klys> except anything you've hooked to the pic is also available via the apic, so why not mask out your pic
14:14:41 <doug16k> I do mask it out. you can't stop it from sending spurious interrupts though. I want spurious handling to be the lowest priority
14:14:57 --- join: graphene (~graphene@46.101.134.251) joined #osdev
14:15:10 --- quit: graphene (Remote host closed the connection)
14:15:21 --- join: trout (~variable@freebsd/developer/variable) joined #osdev
14:15:22 <klys> then yeah, i'm afraid it's by accident, though 0xf0-0xff are the lowest priority in that case.
14:16:02 --- join: bluezinc (~bluezinc@unaffiliated/bluezinc) joined #osdev
14:16:08 --- quit: bluezinc (Quit: Do not go gentle into that goodnight)
14:16:14 <klys> I'm not about to write it into a standard, though.
14:16:22 <geist> question is whether or not that actually matters at all
14:16:24 --- join: bluezinc (~bluezinc@unaffiliated/bluezinc) joined #osdev
14:16:27 <doug16k> when I say it "masks" it I mean it prevents it from transitioning from "requested" to in "service". when an interrupt transitions from requested to in service, it clears the request bit so it can become set again on another request if another IRQ occurs while it is in service
14:16:28 <geist> do MSIs go through the same logic?
14:16:54 --- join: graphene (~graphene@46.101.134.251) joined #osdev
14:17:02 <doug16k> yes
14:18:56 <doug16k> ...that's why it is possible to EOI after the handler, even if the handler acks the device. if the device sends another IRQ right after you ack the interrupt at the device, it won't lose it when you EOI after the ISR - it will be "enqueued" in the interrupt request bitmap
14:19:09 --- quit: variable (Ping timeout: 276 seconds)
14:20:50 <doug16k> vector number is the priority scheme because it selects the lowest bit set in the request bitmap when choosing an interrupt to deliver to the core
14:21:25 <doug16k> lowest bit set which is not a higher bit than the lowest bit set in the in service bitmap*
14:23:50 <doug16k> geist, right, it doesn't matter very much if at all in the spurious PIC case. it doesn't hurt to put them at a more sensible priority though
14:27:08 --- join: asymptotically (~asymptoti@gateway/tor-sasl/asymptotically) joined #osdev
14:30:21 <doug16k> I was also thinking about whether it would be worthwhile to mask the scheduler preemption IRQ (in my case, the LAPIC timer IRQ) when blocking preemption. would the expense of masking/unmasking it overwhelm cost of taking no-op schedule IRQs? I'm guessing it might be worse
14:37:36 --- quit: epony (Quit: QUIT)
14:38:02 --- quit: graphene (Remote host closed the connection)
14:39:35 --- join: graphene (~graphene@46.101.134.251) joined #osdev
14:43:36 --- quit: JusticeEX (Ping timeout: 260 seconds)
14:45:17 --- quit: lldd_ (Quit: Leaving)
14:46:11 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
14:47:20 --- quit: alyptik (Ping timeout: 244 seconds)
14:47:53 --- join: alyptik (ayy@cpe-76-173-133-37.hawaii.res.rr.com) joined #osdev
14:48:01 --- join: isaac_ (~isaac@host81-129-159-113.range81-129.btcentralplus.com) joined #osdev
14:48:21 --- nick: isaac_ -> isaacwoods
14:50:21 --- quit: trout (Ping timeout: 276 seconds)
14:52:50 --- join: epony (~nym@77-85-135-149.ip.btc-net.bg) joined #osdev
14:57:23 --- quit: variable (Quit: /dev/null is full)
14:57:58 --- join: ampotos (~ampotos@lew31-1-78-247-114-197.fbx.proxad.net) joined #osdev
14:58:06 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
14:58:09 --- quit: variable (Client Quit)
14:58:42 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
14:58:55 --- quit: variable (Client Quit)
14:59:13 <geist> doug16k: well either way, i doubt it's worth worrying about too much
15:00:19 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
15:00:28 --- quit: variable (Client Quit)
15:04:07 --- quit: mavhq (Read error: Connection reset by peer)
15:05:20 --- join: mavhq (~quassel@cpc77319-basf12-2-0-cust433.12-3.cable.virginm.net) joined #osdev
15:09:37 --- quit: asymptotically (Quit: Leaving)
15:14:49 --- quit: Kimundi_ (Ping timeout: 240 seconds)
15:14:50 --- join: banisterfiend (~banister@ruby/staff/banisterfiend) joined #osdev
15:15:33 --- quit: HZun (Quit: Leaving)
15:17:18 --- quit: gattuso (Remote host closed the connection)
15:17:29 --- join: Kimundi_ (~Kimundi@i577A9E65.versanet.de) joined #osdev
15:18:28 --- join: gattuso (~gattuso@pompel.me) joined #osdev
15:22:41 --- quit: ZipCPU (Ping timeout: 260 seconds)
15:30:35 --- join: JenElizabeth (~JenElizab@cpc76794-brmb10-2-0-cust363.1-3.cable.virginm.net) joined #osdev
15:39:00 --- join: JusticeEX (~justiceex@pool-98-113-143-43.nycmny.fios.verizon.net) joined #osdev
15:46:36 --- quit: Asu (Quit: Konversation terminated!)
15:52:18 --- join: sysfault_ (~exalted@pool-108-53-210-20.nwrknj.fios.verizon.net) joined #osdev
15:53:33 --- join: nwm (~nwm@d162-156-46-158.bchsia.telus.net) joined #osdev
15:54:44 --- quit: sysfault (Ping timeout: 264 seconds)
15:56:54 <CrystalMath> so... i'm starting to think about windowing system architectures
15:57:18 <CrystalMath> there's no way to map a rectangle of a framebuffer separately, right?
15:58:04 <bcos_> Not arbitrary rectangles, no
15:58:42 <CrystalMath> maybe a full-width slice
15:58:46 <CrystalMath> with some height
16:00:24 <CrystalMath> but those are probably not very useful
16:00:26 <bcos_> You know how you can use a nice "open(), read(), write(), ..." file IO abstraction, so that applications don't end up being infested with low level hardware details for storage devices?
16:00:42 <CrystalMath> yes
16:00:50 <bcos_> That's what drivers are for
16:00:57 <CrystalMath> well of course
16:01:08 <CrystalMath> i'm just trying to think of a way for programs to paint their windows fast
16:01:20 <bcos_> For video, what if the video driver provided a nice "standardised 32-bpp RGB textures" abstraction?
16:01:38 <CrystalMath> well clearly that would work
16:01:42 <bcos_> ..and GUI just shoved these textures down a 3D graphcs pipeline
16:01:56 <CrystalMath> wouldn't it be too slow?
16:02:18 <bcos_> ..so that you could have windows wrapped around cylinders or at freaky angles, or ...
16:02:46 <CrystalMath> that is really cool
16:03:00 <CrystalMath> however, my OS does not assume any 3D acceleration is available
16:03:04 <CrystalMath> it assumes a 486
16:03:05 <bcos_> Because all modern video cards are designed for 3D (and have elaborate accelerators/GPUs), it'd be faster than allowing applications to diddle with framebuffer directly
16:03:56 <bcos_> Ah - for 80486 you're mostly screwed
16:04:08 <CrystalMath> VESA doesn't really have acceleration
16:04:26 <CrystalMath> sure there's VESA/AF but i've never seen it working
16:04:28 <bcos_> Erm. VESA had "VBE/AF" to support 2D accelerators
16:04:32 * bcos_ nods
16:04:41 <CrystalMath> i guess i'll bitblt with that
16:04:48 <CrystalMath> if it's there
16:05:12 <CrystalMath> and 3D, well
16:05:19 <CrystalMath> i don't even have 3D acceleration in my GNU/Linux
16:05:37 <bcos_> The basic "application creates abstract 2D textures" approach would (should?) still be used for ancient unaccelerated video though
16:06:12 <CrystalMath> well, assuming i don't do any transformations
16:06:15 <CrystalMath> it should be a simple copy
16:06:17 <CrystalMath> to the framebuffer
16:06:31 <bcos_> ..where video driver can use painter's algorithm to combine all the textures and build the framebuffer
16:06:31 --- quit: Lowl3v3l (Ping timeout: 248 seconds)
16:06:42 * bcos_ nods
16:07:30 <bcos_> ..probably want to use some kind of "dirty rectangles" thing for that. E.g. if a window/texture in the bottom left of the screen was changed (but nothing else was); then only rebuild the bottom left of the framebuffer
16:07:42 <CrystalMath> well of course
16:07:53 <CrystalMath> on windows csrss does that even for command prompt windows :P
16:08:02 <bcos_> :-)
16:08:16 <CrystalMath> tbh they have an interesting architecture for that
16:08:19 --- join: zesterer (~zesterer@91.254.200.146.dyn.plus.net) joined #osdev
16:08:22 <CrystalMath> did you know graphics is possible in those windows?
16:08:28 <CrystalMath> there is a secret API for it
16:08:34 <CrystalMath> which is implemented in ReactOS
16:08:53 <CrystalMath> you get a framebuffer which is allocated in csrss, and then you access it using a shared memory section
16:09:02 <CrystalMath> while holding a shared mutex
16:09:16 <bcos_> It's all just a texture (although I think Windows calls them "canvases")
16:09:39 <CrystalMath> true, but this is allocated in the server process
16:09:58 <CrystalMath> rather than kept in the client
16:10:07 <CrystalMath> so it's interesting
16:10:21 <CrystalMath> but i think it'd be better to keep them in the client
16:10:25 <CrystalMath> and then let the server read them
16:10:30 <CrystalMath> through a shared section
16:10:31 <bcos_> Well, regardless of who allocated it, it'd have to be shared between app and video driver
16:10:57 <CrystalMath> and then there are address space limitations
16:11:18 <CrystalMath> i probably can't have all of them mapped at the same time
16:11:45 <bcos_> ?
16:11:58 <CrystalMath> it could run out of mapping space
16:12:04 <CrystalMath> there might be no virtual memory for all of them
16:12:09 <CrystalMath> on a 486 it's 4 GB
16:12:20 <bcos_> If they're all ~ 1 MiB and video driver has 3 GiB of space, then you'd be limited to about 3000 windows
16:12:36 <CrystalMath> 3,000 at a time
16:12:45 <CrystalMath> but i can probably think of something to swap some out
16:12:53 <bcos_> 3000 mapped at the same time (unlimited not mapped)
16:12:54 <CrystalMath> when i run out of space
16:13:01 <CrystalMath> slide a window over all of them
16:13:07 <CrystalMath> during the drawing
16:13:12 <bcos_> In practice, for 80486 you'll run out of RAM first
16:13:27 <CrystalMath> hmm...
16:13:36 <CrystalMath> yeah but on a 32-bit 4 GB system, i won't
16:13:37 <bcos_> (from memory, most of those machines only had about 16 MiB of RAM, so...)
16:14:04 <CrystalMath> a 32-bit 4 GB system would be some pentium IV deliberated running in 32-bit mode
16:14:10 <CrystalMath> *deliberately'
16:14:13 <CrystalMath> *deliberately
16:14:22 <bcos_> (...and it's probably not a good idea to use swap space for video buffers - "frames per hour" instead of "frames per second")
16:14:42 <CrystalMath> hmm...
16:15:07 <drakonis> what if i'm using an ssd :V?
16:15:18 <CrystalMath> so i need to make it allocate to RAM only, if there's no RAM, forget it
16:15:20 <CrystalMath> that's fine
16:15:30 <CrystalMath> but
16:15:51 <CrystalMath> then only the server can allocate them
16:16:02 <CrystalMath> letting unprivileged processes just allocate memory which can never be swapped out
16:16:04 <CrystalMath> doesn't sound good
16:16:33 --- join: zeus1 (~zeus@197.239.32.36) joined #osdev
16:16:51 <bcos_> I wouldn't say "never" - if an window has been minimised for 4 days then...
16:17:15 <bcos_> ..and things that are actually visible will be accessed often enough to keep them away from swap
16:17:31 <bcos_> (assuming some type of "least recently used" algorithm)
16:18:05 <CrystalMath> hmm... yeah
16:18:13 <bcos_> So you're mostly just wanting "if(buffer size < free physical RAM) { allocate like normal } else { probably don't do that }"
16:21:53 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-190-247.002.203.pools.vodafone-ip.de) joined #osdev
16:23:34 <CrystalMath> yeah i guess
16:25:04 <bcos_> I'd also consider lifting the requirements - 80486 is a bit too slow/restrictive and they're extremely rare
16:25:48 <bcos_> (Pentium was 25 years ago now)
16:27:27 <booyah> feeling old yet?
16:27:44 <booyah> 486 was relesed over 40 years ago. feeling old?
16:27:50 <bcos_> Don't forget that for graphics, something like MMX or SSE could help a lot
16:28:07 <bcos_> booyah: Um, 40?
16:29:06 <bcos_> (80486 was 1989, which is 29 years ago)
16:29:55 --- join: ljc (~ljc@unaffiliated/ljc) joined #osdev
16:30:33 <bcos_> Hmm - 8086 was 40 years ago
16:36:56 --- quit: sortie (Quit: Leaving)
16:39:03 <CrystalMath> hmm... so i'm as old as pentium
16:39:28 --- join: ZipCPU (~ZipCPU@pool-72-73-35-102.clppva.fios.verizon.net) joined #osdev
16:39:41 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
16:54:51 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-255-235.002.203.pools.vodafone-ip.de) joined #osdev
16:59:44 --- quit: quc (Remote host closed the connection)
16:59:59 --- join: quc (~quc@host-89-230-167-218.dynamic.mm.pl) joined #osdev
17:12:24 --- quit: mavhq (Read error: Connection reset by peer)
17:13:41 --- join: mavhq (~quassel@cpc77319-basf12-2-0-cust433.12-3.cable.virginm.net) joined #osdev
17:17:31 --- part: AldrinZigmund[m] left #osdev
17:22:47 --- quit: MrOnlineCoderX (Read error: Connection reset by peer)
17:24:23 --- join: CheckDavid (uid14990@gateway/web/irccloud.com/x-wsxnmwixvsszhymp) joined #osdev
17:27:45 --- quit: Lowl3v3l (Ping timeout: 268 seconds)
17:30:53 --- join: jpzhu (~jpzhu@115.29.6.106) joined #osdev
17:36:32 --- join: tanner00 (adefc54c@gateway/web/freenode/ip.173.239.197.76) joined #osdev
17:41:20 --- join: hmmmmm (~sdfgsf@pool-72-79-165-242.sctnpa.east.verizon.net) joined #osdev
17:41:24 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-255-103.002.203.pools.vodafone-ip.de) joined #osdev
17:43:56 --- join: hmmmmmm (~sdfgsf@pool-72-79-160-146.sctnpa.east.verizon.net) joined #osdev
17:44:02 --- quit: hmmmm (Ping timeout: 244 seconds)
17:45:48 --- quit: spare (Remote host closed the connection)
17:46:46 --- quit: hmmmmm (Ping timeout: 260 seconds)
17:47:12 --- quit: [TheGame] (Quit: There are paranoid crossroads and shipwreck alleys.)
17:49:41 --- quit: Lowl3v3l (Ping timeout: 260 seconds)
17:51:48 --- join: [WaterMotion] (~while@unaffiliated/awaxx/x-0928682) joined #osdev
17:55:06 --- quit: Tazmain (Quit: Leaving)
17:56:57 --- quit: zeus1 (Ping timeout: 240 seconds)
18:02:59 --- join: hmmmmm (~sdfgsf@pool-72-79-168-226.sctnpa.east.verizon.net) joined #osdev
18:04:33 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-207-103-051.002.207.pools.vodafone-ip.de) joined #osdev
18:06:08 --- quit: hmmmmmm (Ping timeout: 264 seconds)
18:09:21 --- quit: Kimundi_ (Ping timeout: 244 seconds)
18:10:33 --- quit: pie_ (Quit: Leaving)
18:12:16 --- join: pie_ (~pie_@unaffiliated/pie-/x-0787662) joined #osdev
18:12:23 --- join: hmmmmmm (~sdfgsf@pool-72-79-162-103.sctnpa.east.verizon.net) joined #osdev
18:14:49 --- quit: hmmmmm (Ping timeout: 240 seconds)
18:14:56 --- quit: isaacwoods (Quit: isaacwoods)
18:16:57 --- join: Jari-- (~vai@85-76-111-142-nat.elisa-mobile.fi) joined #osdev
18:16:58 <Jari--> https://pastebin.com/qHTQG2GS
18:17:00 <bslsk05> pastebin.com: [C] JTMOS PS/2 Mouse Driver rev. 2006 - Pastebin.com
18:17:11 <Jari--> can you tell me what I am doing wrong with the PS/2 mouse device?
18:17:18 <Jari--> +hi all
18:17:34 <Jari--> in qemu the mouse moves very strangely
18:17:41 <Jari--> cant operate with it, at all
18:18:10 --- quit: Shikadi (Read error: Connection reset by peer)
18:18:42 <Jari--> I am planning to build up a company on JTMOS Operating System
18:18:46 <Jari--> JTMOS Plc.
18:20:30 --- join: hmmmmm (~sdfgsf@pool-72-79-164-110.sctnpa.east.verizon.net) joined #osdev
18:22:57 --- quit: hmmmmmm (Ping timeout: 240 seconds)
18:24:23 --- join: hmmmmmm (~sdfgsf@pool-72-79-163-166.sctnpa.east.verizon.net) joined #osdev
18:25:36 <booyah> Jari--: company doing what?
18:26:02 --- join: jakogut_ (~jakogut@162.251.69.147) joined #osdev
18:27:19 --- quit: hmmmmm (Ping timeout: 240 seconds)
18:27:20 --- join: hmmmm (~sdfgsf@pool-72-79-164-165.sctnpa.east.verizon.net) joined #osdev
18:28:55 --- quit: hmmmmmm (Ping timeout: 264 seconds)
18:29:41 <Mutabah> Jari--: Do you have a referernce to what it actually does (observed behavior, inputs/outputs)
18:31:16 <Jari--> Mutabah: 2006 last time I touched this code
18:31:30 <Jari--> an operating system, would take probably months or even years to gather up the customers
18:31:32 --- join: hmmmmm (~sdfgsf@pool-72-79-165-72.sctnpa.east.verizon.net) joined #osdev
18:31:40 <Jari--> still worthwhile
18:32:52 <Jari--> dpkg: dependency problems prevent configuration of cpp-2.95:i386:
18:32:52 <Jari--> cpp-2.95:i386 depends on libc6 (>= 2.3.4-1).
18:32:59 <Jari--> how to overcome this?
18:34:01 --- quit: hmmmm (Ping timeout: 260 seconds)
18:34:10 <Jari--> found help at: http://alex.nisnevich.com/blog/2013/02/07/installing_brother_printer.html
18:34:11 <bslsk05> alex.nisnevich.com: Installing a Brother printer on 64-bit Ubuntu/Debian - AlexNisnevich.blog
18:38:07 --- join: hmmmmmm (~sdfgsf@pool-72-79-166-79.sctnpa.east.verizon.net) joined #osdev
18:38:12 <Jari--> dpkg -x package.deb /tmp/out
18:38:17 --- quit: hmmmmm (Ping timeout: 244 seconds)
18:39:50 <doug16k> Jari--, if the mouse moves strangely, it's likely that your code has gotten out of sync with the packet stream. you should keep track of the last time you got an IRQ, and if it is more than a 100ms or so, reset your packet offset state variable and assume the next byte is the start of a new packet
18:40:39 --- join: zeus1 (~zeus@197.239.32.36) joined #osdev
18:42:10 --- join: hmmmmm (~sdfgsf@pool-72-79-167-132.sctnpa.east.verizon.net) joined #osdev
18:44:15 <doug16k> Jari--, like this -> https://github.com/doug65536/dgos/blob/master/kernel/device/keyb8042.cc#L205
18:44:17 <bslsk05> github.com: dgos/keyb8042.cc at master · doug65536/dgos · GitHub
18:44:23 --- quit: hmmmmmm (Ping timeout: 248 seconds)
18:45:10 --- join: hmmmm (~sdfgsf@pool-72-79-165-204.sctnpa.east.verizon.net) joined #osdev
18:46:31 --- quit: hmmmmm (Ping timeout: 248 seconds)
18:46:44 --- quit: graphene (Remote host closed the connection)
18:48:13 --- join: graphene (~graphene@46.101.134.251) joined #osdev
18:50:15 --- quit: hmmmm (Ping timeout: 248 seconds)
18:56:02 --- join: spare (~user@unaffiliated/spareproject) joined #osdev
18:58:38 --- join: adam4813 (uid52180@gateway/web/irccloud.com/x-metwwaslchcyxbfs) joined #osdev
19:04:37 --- quit: pie_ (Remote host closed the connection)
19:04:38 --- join: pie__ (~pie_@unaffiliated/pie-/x-0787662) joined #osdev
19:04:49 --- quit: magnificrab (Ping timeout: 240 seconds)
19:05:30 --- join: magnificrab (~pi@189.171.148.122.sta.dodo.net.au) joined #osdev
19:06:35 --- quit: spare (Quit: leaving)
19:10:00 --- quit: graphene (Remote host closed the connection)
19:11:42 --- join: graphene (~graphene@46.101.134.251) joined #osdev
19:14:02 <doug16k> Jari--, whoa. you block and synchronously read the next three bytes in the ISR when you get a mouse IRQ? and you disable the keyboard every mouse IRQ? don't do that
19:14:42 <geist> yah that's no bueno
19:14:56 <geist> probably always got away withi t because most emulators probably prepare all the bytes in advance
19:15:51 --- quit: zeus1 (Ping timeout: 248 seconds)
19:17:22 --- quit: ljc (Ping timeout: 256 seconds)
19:21:36 <doug16k> Jari--, you should expect one byte when you get a mouse IRQ, and one byte when you get a keyboard IRQ. have a state machine track progress of mouse packet queue up the bytes and track multi-byte scancodes and act upon them when you have a full packet/scancode-sequence. you can assume that the input from the data port will be the appropriate device's byte when you just received the IRQ for that device, no need to disable anything
19:23:01 --- quit: JusticeEX (Ping timeout: 260 seconds)
19:24:58 --- quit: tanner00 (Ping timeout: 252 seconds)
19:29:05 <doug16k> Jari--, this is how I deal with getting one byte at a time in keyboard IRQ -> https://github.com/doug65536/dgos/blob/master/kernel/device/keyb8042.cc#L120
19:29:06 <bslsk05> github.com: dgos/keyb8042.cc at master · doug65536/dgos · GitHub
19:30:11 <doug16k> it examines the byte to determine if it should expect another byte (and another and another, for weird keys like pause) and advances the `state` accordingly
19:30:31 <geist> yep state machines make the world go round
19:38:08 <klange> i'm pretty sure that's physics, not state machines, but...
19:38:31 <geist> what is physics but a set of tiny state machines
19:38:34 <geist> ey?
19:41:45 --- join: ljc (~ljc@unaffiliated/ljc) joined #osdev
19:44:20 --- quit: freakazoid0223 (Read error: No route to host)
19:44:52 --- quit: banisterfiend (Quit: Textual IRC Client: www.textualapp.com)
19:46:03 <Jari--> Does todays PC have PS/2 mouse and keyboard support?
19:46:38 <Jari--> I am planning to hire C programmers
19:46:43 <Jari--> what is a good place to look?
19:47:02 <Jari--> the code should be cleaned up for modern GCC
19:47:04 <klange> Lots of modern systems emulate PS/2 keyboards for USB keyboards up until the point where you start talking to the USB controller.
19:47:13 <immibis> where would you hire any other language programmers from? try there.
19:47:13 <geist> yep
19:47:46 <immibis> just checked and my motherboard (couple years old) has ONE "universal" PS/2 port
19:48:11 <klange> My current motherboard actually has two :D
19:48:20 <klange> And it's only two years old.
19:48:39 <Jari--> hiii
19:48:48 <Jari--> anyone know how I can build a bootable USB stick?
19:48:53 <geist> yah some are going to the single port. i think it's primarily because some gamer types and whatnot still like ps2 keyboards
19:48:54 <Jari--> do I have to use FreeDOS ?
19:48:57 <immibis> if not for pause/break i'd say PS/2 was a neat protocol
19:48:59 <geist> whereas ps2 mice are not really a thing
19:49:03 <klange> n-key rollover, baby
19:49:07 <immibis> geist: apparently windows only supports 6-key rollover for USB keyboards
19:49:10 <Jari--> my kernel has a dos loader
19:49:12 <geist> and low latency
19:49:28 <immibis> allegedly, the USB standard says "this is the maximum rollover", and the example had 6, and some microsoft intern probably read the example and thought 6 was enough for anybody
19:49:29 <klange> The emulation for USB keyboards is also likely to support DOS.
19:49:39 <immibis> "this field is"*
19:49:57 <klange> Who needs a mouse in DOS?
19:49:58 <geist> the basic usb keyboard protocol is just a report of the state of 6 keys, iirc
19:50:09 <geist> the driver has to synthesize the up down for that
19:50:11 <immibis> geist: is it actually fixed at 6 though? or is it part of the device configuration
19:50:17 <geist> there are more advanced usb hid stuff though
19:50:34 <geist> it's just the basic usb keyboard protocol
19:50:51 <geist> you can switch to the more advanced version if the keyboardf supports it
19:51:36 --- quit: zesterer (Ping timeout: 260 seconds)
19:51:49 <immibis> then allegedly windows doesn't support the more advanced protocol
19:52:10 <immibis> i've heard of keyboards that present themself as a hub with 17 keyboards attached in order to get full rollover on windows
19:52:14 <geist> and/or it's like most random internet stuff, its wrong
19:52:47 <immibis> or that. but then you'd think someone would correct the misconception after people started going back to PS/2
19:52:59 <geist> how does one fix the internet?
19:53:09 <immibis> turn it off and on again?
19:53:21 <geist> ps/2 is kind of nice too because it's event based. theoretically the delay is a bit lower
19:53:32 <geist> though that's a bit lame
19:53:33 --- quit: zopsi (Quit: Oops)
19:54:21 <doug16k> Jari--, it is very likely that even a brand new laptop has PS/2, at least for the keyboard, and it's likely for the touchpad too
19:54:24 <immibis> i was considering using PS/2 for my homebuilt computer, it looks simple enough except for: A) host to device communication and B) the whole pause/break thing
19:54:54 <immibis> USB wins for versatility but PS/2 seems to do exactly what it's designed for, a lot better (except for pause/break)
19:55:06 <immibis> actually i forget if it was pause/break or print-screen that has the stupid code
19:55:32 <doug16k> pause has the weird 3 byte sequence
19:55:34 <Jari--> doug16k: great!
19:55:39 --- join: zopsi (~zopsi@dir.ac) joined #osdev
19:55:40 <Jari--> I like PS/2
19:55:46 <doug16k> printscreen is weird because it doesn't report key-up IIRC
19:55:49 <Jari--> maybe the driver works well on real hardware?
19:55:50 <Mutabah> Electrically it's a little complex
19:56:05 <Jari--> VMware, where it works well, is closer to real hardware probably than VMware? possible?
19:56:09 <immibis> not the 3 byte sequence, the 8 byte sequence
19:56:10 <doug16k> oh wait, no, printscreen has no typematic
19:56:12 <Jari--> qemu mouse emulation is weird ?
19:56:15 <Mutabah> immibis: Yeah, it's quirky but it's designed for making the hardware simple
19:56:45 <immibis> Mutabah: it's not quirky at all! except for this one quirk which i expect was a compatibility hack
19:57:06 <Jari--> anyone who needs a job on C, report at https://www.toptal.com
19:57:07 <bslsk05> www.toptal.com: Toptal - Hire Freelance Talent from the Top 3%
19:57:19 --- quit: nwm (Ping timeout: 240 seconds)
19:57:44 <Jari--> salaries are Western standard I would offer
19:57:46 <immibis> heh. everyone has the top 3%
19:58:00 <immibis> also i'd say that is spam
19:58:01 <doug16k> alt-printscreen is also weird, instead of being the same scancode as printscreen it is a separate scancode
19:58:09 <doug16k> alt-printscreen = sysrq
19:58:10 <Jari--> immibis: got a better site?
19:58:24 <Jari--> getacoder.com has unbelievable low saleries!
19:58:28 <Jari--> do you know?
19:58:40 <Jari--> contrast
19:59:16 <Jari--> used to work for www.axxion.fi
19:59:17 <bslsk05> www.axxion.fi: Yritys - Axxion
19:59:25 --- join: zeus1 (~zeus@197.239.32.36) joined #osdev
19:59:35 <immibis> doug16k: yeah, compatibility hacks, since sysrq used to be a separate key IIRC
19:59:48 <klys> jari--, were you kerravon?
20:00:04 <Jari--> klys: Jer of Panic
20:00:45 <klys> well I was talking to a dude this week who had a kernel installable via sys.com
20:00:57 <Jari--> what Microsoft pays kernel developers, something similar :)
20:01:20 <Jari--> klys: DOS is great, all it lacks is system processes and threading
20:01:37 <doug16k> and SMP!
20:01:37 <Jari--> had great fun with MS-DOS before
20:01:46 <klys> jari--, and a good file format, unless you're using DJELF
20:01:49 <doug16k> and a decent memory model
20:01:56 <doug16k> and a shred of exception handling
20:02:21 <Jari--> doug16k: klys immibis bslsk05 : postman is the process that does actual scheduling for tasks like VGA/VESA, file system, sounds, etc.
20:02:24 <Jari--> multimedia
20:02:55 <Jari--> otherwise it would cause a threading syndrome, accessing same hardware at multiple counts, which is not safe!
20:03:41 <klys> would anyone like to see some notes on real-mode 32-bit memory allocation?
20:03:56 <immibis> Jari--: are you a markov chain?
20:04:03 <Jari--> immibis: nopes
20:04:18 <Jari--> markov what?
20:04:22 * immibis should pitch the idea of LORA/6LoWPAN management networks at work
20:04:31 <immibis> it's a basic type of AI sentence generator
20:04:45 <Jari--> http://www.xtremesearch.xyz
20:04:46 <bslsk05> www.xtremesearch.xyz <no title>
20:04:51 <Jari--> the search engine I built for fun
20:05:00 <Jari--> currently the image search is broken
20:05:06 <Jari--> cant wget images for it
20:05:14 <immibis> it just observes which words come after which other words and then puts them together that way.
20:05:25 <doug16k> wouldn't a bot know how to recognize being asked if it is a bot though?
20:05:44 <doug16k> that's step 1 of making a bot, isn't it?
20:06:02 <klange> none of my markov chain bots bother
20:06:17 <immibis> only if you're trying to pass it off as human AND have the technology to make it recognise the question in the first place
20:06:31 <Jari--> doug16k: I use Lynx and wget, try to report it is my search engine's crawler
20:06:36 <immibis> what's the syntactical difference between "are you a markov chain?" and "are you a flesh bag?"
20:06:47 <klange> Negative, I am a meat popsicle.
20:06:57 <Mutabah> immibis: Not a lot, they're the same gramatical structure
20:07:08 <Jari--> does anyone here have a company?
20:07:18 <Jari--> tough and takes all time? I hope not!
20:07:29 <klys> jeri--, why pay the business license fee?
20:07:40 <Jari--> klys: if it is possible then I would
20:07:57 <immibis> Jari--: technically i do
20:08:16 <immibis> (i say technically, because the company has never done anything, but it's registered :P)
20:08:37 <Jari--> immibis: can you actually register the products?
20:09:06 <Jari--> write on description I guess?
20:09:07 <Jari--> hehe
20:09:10 <doug16k> I'd like to see a bot answer this properly: "when you eat a popsicle, wood it be a good idea to eat the stick?"
20:09:38 <immibis> SyntaxError: expected verb near "wood it be a good idea to eat the stick?"
20:09:48 <Jari--> should I use C# or Java for OS development? it seems so fashionable anyways
20:09:54 * immibis has left the channel (Connection reset by peer)
20:10:00 <immibis> Jari--: are you a flesh bag?
20:10:10 * klange sees a shark get jumped over
20:10:16 <Jari--> immibis: C is much more interesting for me, beats performance of most languages
20:10:22 <Jari--> assembly for interrupt handlers only!
20:10:26 --- mode: ChanServ set +o klange
20:10:49 <Jari--> you can actually compile C++ to C
20:10:56 <Jari--> this way you can integrate it into the kernel
20:11:07 <Jari--> though why not make it C?
20:11:09 <immibis> i had a plugin for MSN once that would repeat back random messages that someone else has said to me in the past
20:11:16 --- join: nwm (~nwm@d162-156-46-158.bchsia.telus.net) joined #osdev
20:11:27 <immibis> this reminds me of that
20:11:37 <Jari--> time for my pudding
20:13:42 <immibis> translation: warning received and understood
20:14:54 <klys> ^,,^
20:16:15 <Jari--> does anyone know Michai Ramakers?
20:16:24 <Jari--> he sent me a laptop to use for JTMOS
20:16:34 <Jari--> would be nice addon for the team
20:17:20 <klys> please link some of this stuff you're talking about i'm so lost
20:18:02 <immibis> probably stands for Jari Middlename Lastname's Operating System?
20:18:07 <Jari--> klys: does Linux kernel developers have a clue on custom full-stack OS development?
20:18:40 <Jari--> immibis: Jari Tuominen's Minimal multimedia Operating System
20:18:55 <klys> jari-- linux programmers are difficult to spot in the wild. you should try to find one yourself.
20:19:14 <immibis> i've worked on linux kernel stuff. it's really just another program for the most part
20:19:31 <immibis> (none of the code in your normal linux kernel though.custom embedded stuff)
20:19:57 <Jari--> you can say I won a lottery ticket
20:20:10 <Jari--> otherwise I would be quiet on hiring
20:20:19 <Jari--> lol
20:20:41 <Jari--> have to deal lots of things first with bank though
20:21:36 <Jari--> can I create a channel, #jtmos, on freenode?
20:21:40 <klys> so you're someone who invested in a cruptocurrency and forgot to ask your broker about withdrawal fees?
20:22:36 <Jari--> :)
20:23:24 <Jari--> Linus Torvalds is Finnish also like me
20:23:54 <klys> or did you click on spam and find someone wanting to wire you money via western union or moneygram?
20:24:09 <immibis> anyone can create a channel, i think there are some guidelines but I don't know what they are
20:24:10 <Jari--> klys: hehe
20:24:18 <Jari--> immibis: need a bot for it?
20:24:21 <immibis> you can certainly create one for your own project
20:24:24 <immibis> Jari--: /msg chanserv help
20:24:36 <Jari--> immibis: I dont want to do everything myself anymore
20:24:44 <Jari--> thats why I would pay for fixing my code
20:25:07 <immibis> so you're going to turn your hobby OS into a startup?
20:25:14 <Jari--> immibis: definitely
20:25:40 <Jari--> the goal is to get a customer or two, then I would be happy
20:25:46 <Jari--> hire marketing for that
20:25:49 --- quit: zeus1 (Ping timeout: 240 seconds)
20:25:52 <klange> and why would anyone buy your OS?
20:26:06 <Jari--> klange: anyone who needs a serious custom kernel -based OS
20:26:23 <Jari--> satellites would be interesting
20:26:31 <Jari--> hehe
20:26:49 <Lowl3v3l> if this is true and you are neither drunk, an idiot, a troll , a bot or multiple of those. I'd suggest, if you have this kind of money, buying a ferrari and driving around a pile of burning money. Fiscally, thats more reasponsible.
20:26:59 <immibis> OSes aren't products, satellites are
20:27:06 <immibis> (and they're very niche products)
20:27:15 <klange> You can't sell an OS in 2018, only support for one.
20:27:21 <immibis> well, I guess OSes can be products, like windows. But they're really secondary to the actual thing that people buy
20:27:31 <immibis> which is a personal computer
20:27:37 <Jari--> immibis: come on, the market is clearly dictated by Android, iOS and Windows. there is plenty of space, ... only money dictates if you can swim up to the top
20:27:45 <immibis> Jari--: have you heard of FreeRTOS?
20:27:57 <Jari--> immibis: why free? there is always someone who pays
20:28:00 <klange> The market for satellites is pretty well established by things like FreeRTOS.
20:28:04 <Jari--> free for game lamers
20:28:44 <immibis> people who want satellites aren't going to just buy an OS
20:28:45 <Jari--> you can play Quake at satellite then! OMG
20:29:04 <immibis> they're spending millions of dollars per unit. they're going to contract you (or someone) to help with their software
20:29:12 <doug16k> software operating in space has to be incredibly robust
20:29:13 <klange> Does your OS support the embedded hardware used in building space-worthy hardware?
20:29:14 <immibis> they're not just going to be putting off the shelf parts together like installing windows on a PC
20:29:22 <Jari--> immibis: I am thinking it is fun for the first years
20:29:30 <Jari--> immibis: definitely, otherwise it would not evolve
20:29:30 <klys> your balance sheet. assets: time, car, house. liabilities: irc, osdev
20:29:32 <immibis> fun is fine but fun doesn't make money
20:29:47 <immibis> if you want to write a pretend satellite OS, go ahead! but run it in a simulator only...
20:29:59 <Jari--> immibis: I would design a JTMOS computer
20:30:02 <Jari--> personal computer
20:30:18 <klange> So wait, which is this, you want satellites or home computers?
20:30:26 <Lowl3v3l> immibis: well cubesats aren't that expensive. and i know at least of two or three that run raspbian xD
20:30:31 <Jari--> it is possible to recycle existing low-end computers like Core Duo 2, etcs. to make working machines
20:30:44 <Lowl3v3l> Jari--: are you drunk?
20:30:46 <immibis> Lowl3v3l: i guess selling cubesat hardware+OS is a possibility
20:30:53 <Jari--> Lowl3v3l: serious
20:31:02 <Jari--> recycling is a nice thing to do
20:31:08 <immibis> Jari--: and why is your OS better than ubuntu for example for these old computers?
20:31:18 <Jari--> buy out those computers, resell with the OS :-) which runs better than the mainstream alternatives
20:31:28 <Jari--> immibis: the desktop is much more lighter
20:31:35 <Lowl3v3l> Jari--: i am just evaluating wether you are an absolute idiot on the issue, trolling us, drunk or an actual bot.
20:31:40 <immibis> Jari--: don't need your own kernel for that, make a customized linux distro
20:31:42 <klange> Desktop users don't want lighter, they want their Wifi to work.
20:31:57 <immibis> that too
20:32:02 <Jari--> immibis: something like this I expected from #osdev anyway, you all do compete with me!
20:32:34 <Jari--> klange: you need a fat-ass kernel for wifi? hehe
20:32:41 <klange> I need a kernel driver for wifi.
20:32:44 <klange> Do you have a wifi driver?
20:32:54 <Jari--> would buy one and make it open source
20:32:57 <klange> Are you going to convince the manufacturers of every wifi device to make one for your or do you intend to write your own?
20:33:02 <klange> You don't buy drivers.
20:33:07 <Jari--> really?
20:33:08 <klange> Are you going to make your own wifi hardware?
20:33:21 <immibis> for drivers like that you can try porting the linux ones
20:33:26 <doug16k> good luck with wifi. the manufacturers won't tell you if it was raining yesterday, let alone give you a datasheet.
20:33:42 <immibis> you don't have to understand how the device works, necessarily, if you can just translate an existing working driver
20:33:49 <Jari--> doug16k: hire them to do a driver
20:33:55 <Jari--> sell the wifi hardware with the PC
20:33:58 <klange> Jari--: I think you seriously underestimate the challenges of building an OS anyone would want to buy.
20:34:05 <immibis> i think making your own wifi hardware is not out of reach, but not sensible either
20:34:13 <klange> Both from a pure technical standpoint and from a business standpoint.
20:34:16 <immibis> or rather, putting together hardware in a way that you know how it works
20:34:17 <Jari--> klange: you buy technology with an OS
20:34:22 <Jari--> enable features to work
20:34:36 <immibis> Jari--: what would make you buy an OS?
20:34:39 <Lowl3v3l> Jari--: okay by now you are at a budget of at the very least higher double digits.
20:34:40 <Jari--> if it supports what other oses do weakly, slowly, as fast, then I would myself consider buying one!
20:34:57 <Jari--> PC
20:34:59 <Jari--> not OS
20:35:05 <Jari--> the product would be PC
20:35:17 <klange> I thought you were selling an OS for satelites?
20:35:35 <klange> Is it satelite OSes or full PCes for home users? These are very different markets.
20:35:37 <Jari--> klange: yes, but it is a market as big as personal computers really? and as close to us?
20:35:42 <klys> s/at/att/
20:35:47 <klange> There is no market for personal computers with custom OSes.
20:35:56 <Jari--> klange: iOS
20:36:04 <klange> iOS does not run on personal computers, and is not a custom OS.
20:36:08 <klange> That's a phone.
20:36:11 <klange> Do you want to build phones?
20:36:12 <Jari--> they spent at least 10 years for iOS to become as popular as it is now?
20:36:17 <Jari--> Apple sells computers after all
20:36:21 <klange> Apple is Apple.
20:36:26 <Jari--> does not, unlike Microsoft, seperately bill for the OS
20:36:36 <klange> Hundreds of thousands of software developers write software for Apple's OSes.
20:36:45 <klange> People buy iPhones because they have a massive corpus of software.
20:36:53 <Jari--> klange: you can port games and apps indefinitely
20:37:02 <klange> Can you? What's special about your OS?
20:37:05 <Jari--> but that it is far away now
20:37:07 <klange> Does it have support for the graphics hardware?
20:37:07 <Jari--> first some fun
20:37:18 <klange> Who is going to buy your box that does nothing and has no supported hardware?
20:37:33 <Jari--> klange: in the beginning it is always like that
20:37:37 <Jari--> does yours have?
20:37:38 <klange> No it's not.
20:37:43 <Jari--> definitely is
20:37:53 <klange> Maybe for values of "the beginning" equal to the 1970s.
20:37:53 <Lowl3v3l> if i had the money for such a project... i'd do really different stuff with it
20:37:56 <immibis> klange: i'd say the market for personal computers doesn't really care about OS but it does care about specific software
20:38:03 <immibis> "can your OS run Excel? nope? fuck off then"
20:38:16 <immibis> (LibreOffice Calc may work for your grandma)
20:38:25 <klys> when you kiss you're honey, and you're nose is runny, you may think its funny but its not.
20:40:39 <immibis> Jari--: we always think our projects are awesome, but it's not yourself you have to convince, it's the people you want to sell to
20:41:38 <immibis> is there anyone you actually know that you would want to sell your product to?
20:42:09 <immibis> most successful product ideas went through several iterations of trying to figure out what people will buy
20:42:26 <immibis> so you might have a start, but if you end up selling it, it won't be JTMOS that you sell
20:43:33 <doug16k> I don't want to sell mine. I just want to know how it is possible for me to have this intermittent bug that only happens on kvm and bare machines, when it hasn't even enabled interrupts yet and everything is totally deterministic up to that point :)
20:44:17 <klys> doug16k, is the bug an irq?
20:44:31 <doug16k> interrupts are disabled
20:44:38 <klys> is it an interrupt?
20:44:53 <klange> Have you checked for high levels of cosmic background radiation?
20:45:17 --- quit: CheckDavid (Quit: Connection closed for inactivity)
20:45:17 <klys> eye to the telescope
20:45:43 <doug16k> my Geiger counter is in the shop
20:46:22 <doug16k> I don't see any sparkly spots in my vision, so it can't be that bad
20:46:27 <klys> how is the bug manifest to you when you debug?
20:47:52 <doug16k> there's about a 10-20% chance that it will page fault when populating brand new page tables in very early memory manager startup
20:48:09 <klys> and is cr3 set?
20:48:19 <doug16k> yes it is in long mode
20:48:45 <klys> and paging is disabled?
20:48:49 --- quit: Lowl3v3l (Ping timeout: 240 seconds)
20:49:00 <doug16k> it is impossible for paging to be disabled in long mode, by definition
20:49:07 <klys> o then
20:49:42 <klys> your page table diredtories should be set up before entry imo.
20:49:53 <klys> directories*
20:49:55 <doug16k> they are
20:50:27 <doug16k> it is creating tables for a new allocation when it happens
20:50:44 <klys> so you're sure the page fault occurs in long mode, as in you've made a handler and a readout.
20:50:53 <doug16k> er, it created them, and it is touching the page to populate entries
20:51:00 --- quit: graphene (Remote host closed the connection)
20:51:19 <doug16k> yes I have extensive exception handling
20:51:31 <doug16k> I get a stack trace too
20:52:04 <klys> interupts diabled has very little to nothing to do with any page fault, you must realize.
20:52:33 --- join: graphene (~graphene@46.101.134.251) joined #osdev
20:53:01 <doug16k> it is single cpu at that point and interrupts disabled. I mentioned interrupts disabled in the context of it being totally deterministic at that point
20:53:21 <doug16k> control flow should be identical every run, so why intermittent
20:53:35 <klys> does the page fault look speculative?
20:54:29 <doug16k> lazy? no, the PTE is zero
20:55:20 <klys> does your readout include the contents of your PTE ?
20:55:29 --- quit: tacco| ()
20:55:30 <doug16k> https://gist.github.com/doug65536/f495e842db82ef86089c5fd0375da6ae
20:55:32 <bslsk05> gist.github.com: gist:f495e842db82ef86089c5fd0375da6ae · GitHub
20:55:33 <immibis> intermittent sounds like some sort of caching entry. like, are you clearing the PTE you're running from and relying on the TLB to get you past that, or something?
20:55:36 <immibis> caching issue*
20:58:26 <klys> cr3 isn't known?
20:58:27 --- join: hmmmm (~sdfgsf@pool-72-79-160-151.sctnpa.east.verizon.net) joined #osdev
21:00:18 <doug16k> cr3 is shown at the bottom -> PML4: 000000007ffd5063 PADDR=0x7ffd5000 D A W P
21:00:54 <doug16k> ah wait
21:01:04 <doug16k> no that's the PML4 entry. you're right, I forgot to print out cr3
21:01:26 <bcos_> I'd worry more about CR2..
21:01:38 <klys> what's cr2 in long mode?
21:01:43 --- quit: nj0rd (Ping timeout: 240 seconds)
21:02:00 <bcos_> CR2 contains the address of the "not present" page the CPU tried to write to
21:02:16 <bcos_> *the address in the page
21:03:27 <bcos_> ..which to me looks a bit dodgy - not in the last 2 GiB and not near the start of "kernel space - just in the middle of nowhere
21:03:43 <klys> well it seems we know cs:eip, so it should point to a specific instruction, too.
21:03:45 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-195-176.002.203.pools.vodafone-ip.de) joined #osdev
21:08:07 --- quit: Lowl3v3l (Ping timeout: 244 seconds)
21:08:18 <doug16k> bcos_, yeah cr2 does look weird. I should hand-calculate what it should have been
21:08:52 <doug16k> klys, yes the instruction is one that populates a new page table with freshly allocated pages
21:09:22 <doug16k> it's page faulting when attempting to populate a new page table page
21:09:43 --- join: zeus1 (~zeus@197.239.32.36) joined #osdev
21:09:48 <doug16k> it's not like this is some new code. that code has been stress tested before with 16 cpus going nuts allocating and freeing memory
21:10:20 <doug16k> but obviously something isn't right
21:10:46 <klys> is there a reason your pd paddr is > 4 GiB?
21:11:06 --- join: jer64 (~jer64@85-76-111-142-nat.elisa-mobile.fi) joined #osdev
21:11:07 <jer64> hi all
21:11:11 <bcos_> doug16k: Erm - might want to revise the "virtual address space, higher half" table in "x86_64/cpu/mmu.c" - there's only 128 TiB so "-256 TiB" seems a little ambitious...
21:11:13 <klys> ello
21:11:15 <doug16k> this is very early startup. the bootloader allocates pages below 4GB line. the kernel allocates page table pages above 4GB line
21:11:16 <jer64> switched to desktop PC
21:11:19 <jer64> Jari-- here
21:11:38 <jer64> Does anyone know a working ldso-linker?
21:11:46 <jer64> elf linker
21:11:49 <jer64> runtime loader
21:11:59 <klys> jer64, bsd.
21:12:16 <jer64> klys: does it require me to have own libc.so ?
21:12:24 <jer64> and how would it load that up?
21:12:36 <jer64> but
21:12:50 <jer64> my application binaries are statically built
21:12:54 <klys> doug16k, see if you can get us a paste with cr3 and a specific instruction
21:13:45 <doug16k> bcos_, you mean line 247? lol yeah, oops
21:15:23 --- join: nj0rd (~nj0rd@200116b84572bf0085419aab085db334.dip.versatel-1u1.de) joined #osdev
21:19:41 <doug16k> klys, gist updated -> https://gist.github.com/doug65536/f495e842db82ef86089c5fd0375da6ae
21:19:56 <jer64> Did Microsoft buy github?
21:23:05 --- nick: Kazinsal_ -> Kazinsal
21:23:16 <Kazinsal> The acquisition began some time ago yes
21:23:26 <Kazinsal> It has been a complete nothingburger
21:24:00 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-207-103-085.002.207.pools.vodafone-ip.de) joined #osdev
21:24:04 <Kazinsal> As fully expected, "give me free software or give me death" types were freaking out over nothing
21:24:29 <doug16k> I'm half expecting microsoft to go into github and add 180px of padding to every element and quadruple all the font sizes eventually
21:25:59 <doug16k> look what they did to skype. it's bad
21:26:37 <doug16k> 75% of the screen is empty space with a giant circle with your initials on it, and the chat is crammed over to the left
21:28:04 <doug16k> if you're lucky enough to have found out how to even make it show chat in a call, since it is 100% empty with a circle otherwise
21:28:11 <klys> is there a reason your data is at an address calculated by subtracting relatively large numbers from %ebp ?
21:28:47 <doug16k> because it is a debug build and it makes a separate space for every single variable regardless of control flow
21:28:55 <klys> oh ok
21:29:22 <doug16k> nowhere near that much is in scope in any one case
21:30:53 <doug16k> it's about 19 microseconds to map a 4KB page, including allocating virtual address space and allocating physical memory, and clearing it
21:31:13 --- quit: promach_ (Quit: WeeChat 2.1)
21:31:18 <doug16k> and that includes acquiring and releasing an mcslock for the virtual allocation and physical allocation
21:31:19 --- quit: zeus1 (Ping timeout: 240 seconds)
21:31:21 --- join: manzerbredes (~loic@2a01cb0885e31500cfc30bb534d5bc37.ipv6.abo.wanadoo.fr) joined #osdev
21:32:16 <doug16k> IIRC
21:32:29 <geist> that's relatively slow, but i guess it's doing the virtual allocation
21:32:32 <geist> which is probably most of it
21:33:32 <klys> pml4 is pretty close to cr3, are they pointing to the same thing?
21:34:22 <doug16k> oh wait, sorry it was just over 3 microseconds. the bigger number is under TCG :)
21:34:40 <geist> yah 3us is much more like it
21:36:49 <geist> and 3 to 19 is about the slowdown i expect from tcg. usually something like 5x-10x depending on the type of code
21:37:02 <geist> lots of branch heavy stuff like that will not work as well
21:37:06 <doug16k> yeah, 19 is pretty nice considering
21:37:20 <geist> yah
21:37:51 <geist> also in general that's what you see when emulating other arches in TCG
21:38:17 <geist> on the average it's about as good jitting other arches, though as expected i think the quality is a bit better in the x86 case
21:39:21 --- quit: Lowl3v3l (Ping timeout: 268 seconds)
21:40:02 <doug16k> klys, cr3 points to the PML4
21:40:28 <doug16k> PADDR is the physical address of that page table page
21:40:30 <geist> it always points at the top most level you are using at the moment. 2 3 4 or now 5
21:41:04 <klys> doug16k, and the pml4 hides the first four units of address space?
21:42:07 <doug16k> klys, you were pointing out that cr3 and PML4's PADDR=0x7ffd5000 are the same? they are by definition with 48 bit paging. or did I misunderstand your earlier comment?
21:43:03 <doug16k> CR3 holds the physical address of the PML4
21:44:28 <doug16k> the physical addresses are a bit weird there because the bootloader allocates from the top of the 4GB memory for page tables, and the kernel is biased to allocate from above 4GB line
21:44:39 <doug16k> the ones below 4GB line were created by the bootloader
21:45:48 <doug16k> I migrate the PML4 to above 4GB later in mm startup
21:45:57 <klys> does the pml4 contain 4 or 64 entries?
21:46:01 <doug16k> 512
21:46:03 <klys> or 16?
21:46:06 <klys> o
21:46:15 <doug16k> 4KB / 8 = 512
21:46:19 <geist> the math is: 4096 bytes / 8 == 512 entries
21:46:29 <doug16k> ^ thinking in stereo
21:46:38 <klys> 9 bits each and it has 4 entirs
21:46:45 <klys> enttries*
21:46:45 <geist> for those in log 2: 12 - 3 = 9
21:46:51 <doug16k> 9 bits * 4 levels + 12 = 48
21:47:19 <doug16k> 2^12 = 4KB
21:47:27 <klys> pml4 is why called pml4?
21:47:36 <geist> 4th level of page table
21:47:39 <klys> ok
21:48:15 <doug16k> PT (4KB mapping), PD (2MB), PDPT (1GB), PML4 (512GB)
21:48:17 <klys> I remember someone talking about long-mode paging using a 4-entry table at the top
21:48:26 <geist> in 32bit PAE yes
21:48:28 <doug16k> parentheses hold how much space one entry encompasses
21:48:42 <geist> because you end up with 12 + 9 + 9 + 2
21:48:45 <geist> == 32
21:48:52 <klys> right thanks geist.
21:48:58 <doug16k> the PML4/PDPT/PD/PT terminology sucks but I use it now :(
21:49:10 <geist> with pure non pae 32bit, it's 12 + 10 + 10 == 32
21:49:25 <geist> but when the entry sizes doubled you only get 2^9 entries per level
21:49:56 <geist> doug16k: yah i still hate it. i use ARM terminology which just calls it level 0 - level 3
21:50:06 <geist> which is far more straigthforward
21:50:22 <klys> let's see though, your pml4 has an entry that points to the same location as cr3 and I am wondering how you got cr3+0x63 into a table.
21:50:42 <doug16k> that PADDR is the address of that page of the page tables
21:50:53 <doug16k> it's saying the PML4 itself is at that address
21:51:03 <klys> is pml4 a register?
21:51:11 <klys> or a table entry
21:51:18 <doug16k> no, it's the top level of the paging hierarchy
21:51:26 <doug16k> each entry represents a 512GB range of address space
21:51:33 <klys> or something you computed to show us debug output.
21:51:50 <doug16k> it's the goofy terminology intel uses in the manual
21:52:34 <klys> what's the 0x63 and is that even a thing stored anywhere?
21:52:36 <doug16k> I use it because "level 0" might be ambiguous to someone. it isn't clear whether it represents the outermost 4KB mapping level or topmost 512GB level
21:53:03 <geist> doug16k: yah in fact i dont remember which one it is, but i think level 0 has to be the outermost
21:53:20 <geist> because ARM64 has a dynamic number of page levels
21:53:45 <geist> 2 through 4 based on what you set up, so it only makes sense to call theone that's always present (the outermost ones) the lower numbers and count up
21:53:45 <doug16k> the 63 are flag bits in the lower 12 bits of the entry. it is decoded at the end of that line -> D A W P
21:54:00 <doug16k> D=dirty, A=accessed, W=writable, P=present
21:54:15 <klys> where are those flag bits stored? are they calculated from lower entries?
21:54:35 <klys> I am talking about PML4
21:54:36 <doug16k> in various bits of the low 12 bits of the entry in the page table
21:54:53 <geist> at the lowest level that the page table entry exists
21:54:56 <geist> at least the DAW ones
21:55:34 <klys> the entry in the page table has 0x00
21:55:47 --- join: Lowl3v3l (~Lowl3v3l@dslb-002-203-239-105.002.203.pools.vodafone-ip.de) joined #osdev
21:55:57 <doug16k> ah I see what you were talking about. the page table entry seems to point back at the PML4. it does. that's because I'm using recursive mapping :(
21:56:10 <doug16k> I'm redoing it to not use recursive mapping at all in the near future
21:56:17 <geist> i was gonna mention that but i assumed that's not what was going on
21:56:33 <geist> or at least didn't want to complicate things with the inevitable discussion about what recursive mapping is
21:56:36 <klys> recursive curses
21:57:12 <klys> well you've eliminated the first element of pml4 then
21:57:17 <doug16k> you can make recursive mapping really fast though. it's totally O(1) to manipulate any or all levels of the page tables for any address
21:58:15 <doug16k> bad part is, you can't access the page tables for a process other than the current process. you'd have to switch to their page tables
21:58:18 <klys> how much address space is that? 48 bits - 9 == 39 bits or 128 GiB.
21:58:26 <doug16k> 256TB
21:58:35 <doug16k> 128TB user space, 128TB kernel space
21:58:52 <bcos_> The mapping would consume 512 GiB
21:59:10 <klys> what geist said.
21:59:11 <doug16k> oh you meant recursive mapping? yeah, 512GB
21:59:21 <klys> what /bcos/ said, apologies.
21:59:26 <Jari--> re
21:59:42 <klys> anyway...
22:00:22 <klys> if you are populating page tables below that line you're in a loop.
22:00:31 <klys> no
22:00:49 <klys> you can have them point to physical addresses below the line, I suppose.
22:01:29 <klys> anyway you have to point them there before it becomes accessible.
22:01:46 <klys> sigh
22:02:33 <doug16k> recursive mapping makes it trivial to create new mappings. you don't need to chase page table entries - you can instantly locate all (4) entries for an address without reading a single byte from memory
22:03:16 <geist> you still have to walk through it to make sure the entries are present, otherwise you'll recursively fault on yourself
22:03:20 <doug16k> that's why I did it at first. when I was less experienced it was really tricky to handle mapping the page tables to map more page tables
22:03:21 <geist> which is probably not what you want to do
22:03:43 <doug16k> hes you have to check each present bit. that's what I call the "present mask" in my dump
22:03:48 * bcos_ needs to re-think recursive mapping now that all the speculative "spectre-y" stuff is floating around :-(
22:03:57 <doug16k> 0x7 means PML4+PDPT+PD are present
22:04:03 <geist> i also dont like how it generates more dirty TLB entries
22:04:06 <geist> and is x86 specific
22:04:29 <geist> and has SMP concerns
22:04:38 <doug16k> s/hes/yes/
22:04:49 <doug16k> geist, why SMP concerns?
22:05:27 <geist> i just prefer to leave it be as a neato getting started trick
22:05:52 <doug16k> yeah, I'm getting past "getting started" now :)
22:05:55 <klys> mmap() is in which file?
22:06:16 <doug16k> I redid the paging in my bootloader and it blows away the kernel's paging manipulation elegance wise, and performance wise
22:06:17 <geist> i can think of some extra TLB shootdowns that may need to happen when unmapping inner page tables
22:06:44 <geist> since you also need to clean out the entries in the recursive page table hole that may be mapped on other cores
22:06:51 <doug16k> klys, https://github.com/doug65536/dgos/blob/master/kernel/arch/x86_64/cpu/mmu.cc#L2271
22:06:55 <bslsk05> github.com: dgos/mmu.cc at master · doug65536/dgos · GitHub
22:07:07 <klys> thx doug16k
22:07:51 <doug16k> it's weird for it to be named mmap in the kernel right? I went with what I knew off by heart :)
22:08:04 <doug16k> it does have too many scenarios crammed into it now that is is complete
22:08:10 <geist> and unmapping inner page tables is usually not a TLB shootdown event on x86 at least (or at least until you enable the page walker cache management stuff on AMD)
22:08:11 <klys> what's line 2273 (void)offset; is this c++17 or what
22:08:26 <doug16k> klys, that shuts up "unused" warning
22:08:31 <geist> ARM however, yep. you have to maintain the page table walker cache as well, which is very subtle and tricky
22:08:32 <klys> right ok
22:08:43 <doug16k> I could have just deleted the name from the parameter list but it's there for future use
22:10:20 <doug16k> zero_if_false is a branch free code helper. zero_if_false(a, b) means a ? b : 0
22:10:34 <doug16k> select_mask(a, b, c) means a ? b : c
22:12:44 <doug16k> mmu_phys_allocator_t::free_batch_t queues up several physical page deallocations and frees them in a batch to avoid too much locking and code cache pressure
22:13:04 <geist> yah, that's a generally good idea
22:15:53 --- join: zeus1 (~zeus@197.239.32.36) joined #osdev
22:19:16 <klys> only about 5 or so atomic_xchg() here
22:19:44 <doug16k> klys, the page table updates are lock free. only virtual allocation and physical allocation are protected by locks
22:20:18 <doug16k> all cpus can reliably update anywhere in the page tables simultaneously
22:20:34 <geist> i'd be curious to see how you pulled that off. seems fraught with peril
22:20:42 <geist> especially with regards to TLB updates and whatnot
22:23:49 <klys> perhaps some printing would enable us to narrow it down, between MAP_POPULATE, !MAP_PHYSICAL, or MAP_PHYSICAL
22:25:48 <doug16k> klys, this is the one that crashes -> https://github.com/doug65536/dgos/blob/master/kernel/arch/x86_64/cpu/mmu.cc#L2427
22:25:52 <bslsk05> github.com: dgos/mmu.cc at master · doug65536/dgos · GitHub
22:25:59 <doug16k> intermittently, mysteriously
22:26:20 <klys> dright then
22:26:28 <klys> right then
22:26:53 <doug16k> crashing would be fine. sure, a bug or something. but how could it be intermittent if it is that early, everything runs the exact same every time, no interrupts, no SMP, no threads (yet)
22:27:30 <doug16k> if it was later when SMP is up and IRQs are happening, sure, it wouldn't be deterministic anymore
22:27:38 <bcos_> That one is easy - just forget to fill something will zeros (so the behaviour depends on whatever trash firmware left in RAM)
22:27:59 <doug16k> yeah but I initialize all memory with garbage on purpose
22:28:07 <geist> to try to narrow that down, suggestion: pre-fill with garbage.... okay you already did that
22:28:17 --- join: hmmmmm (~sdfgsf@pool-72-79-163-241.sctnpa.east.verizon.net) joined #osdev
22:28:43 <doug16k> -object memory-backend-file,id=ram-node0,mem-path="random-mem.img",size=$(QEMU_RAM),prealloc=no -numa node,nodeid=0,memdev=ram-node0
22:29:00 <doug16k> random-mem.img is a `shred`-ed file
22:29:16 <doug16k> but it is the same garbage every time though
22:29:18 --- quit: zeus1 (Ping timeout: 268 seconds)
22:29:31 <doug16k> I could delete random-mem.img and it would make a new file with different garbage
22:30:12 <doug16k> that found a bunch of bugs though
22:30:29 --- join: hmmmmmm (~sdfgsf@pool-72-79-165-215.sctnpa.east.verizon.net) joined #osdev
22:30:32 <doug16k> also I fill malloc() allocated memory with 0xf0 0xf0 0xf0 ...
22:30:43 <doug16k> but malloc isn't happening yet at the crash point
22:30:57 --- quit: hmmmm (Ping timeout: 240 seconds)
22:32:07 <doug16k> I also have debug mode for my page allocator - it never reuses freed memory, just makes it not present, and puts huge guard region around every allocation, and fills the freed pages with 0xfc before making them not present
22:32:20 <doug16k> er, never reuses freed address space I mean
22:33:04 <doug16k> the fc fill is an attempt to catch accessing freed memory in a race with it being freed
22:33:22 --- quit: hmmmmm (Ping timeout: 244 seconds)
22:34:37 <doug16k> malloc has a page heap debug mode that offsets the pointer to the block so going past the end touches guard page, and puts every allocation in its own pages
22:34:47 <doug16k> I went all out with heap debugging pretty much
22:36:05 <doug16k> I was considering making a heap trace tool, that would emit a stack trace to isa-debugcon and make a tool that captures the stack trace of every allocation and free and do a leak analyzer
22:37:08 --- join: hmmmmm (~sdfgsf@pool-72-79-163-7.sctnpa.east.verizon.net) joined #osdev
22:37:43 <doug16k> I already have a complete call/return trace that logs every function entry and exit in all threads with an ncurses trace viewer. it gzips the stream of calls/returns and decodes the addresses to symbols
22:37:54 --- quit: stoopkid (Quit: Connection closed for inactivity)
22:37:57 <doug16k> ...in the viewer
22:38:44 <doug16k> it builds a separate instrumented kernel executable, and my qemu launcher helper makefile targets have a trace- variation that runs it with call tracing enabled
22:39:19 --- quit: hmmmmmm (Ping timeout: 240 seconds)
22:41:56 --- quit: hmmmmm (Ping timeout: 260 seconds)
22:42:57 --- join: hmmmm (~sdfgsf@pool-72-79-162-21.sctnpa.east.verizon.net) joined #osdev
22:47:04 --- join: hmmmmm (~sdfgsf@pool-72-79-164-143.sctnpa.east.verizon.net) joined #osdev
22:47:46 --- quit: hmmmm (Ping timeout: 260 seconds)
22:48:54 --- join: hmmmmmm (~sdfgsf@pool-72-79-163-252.sctnpa.east.verizon.net) joined #osdev
22:51:22 <doug16k> geist, oh, yeah the lock free concurrent page table updates aren't totally foolproof. you mean what if another TLB has a freed page cached right? I planned to make it defer adding freed pages to the free pool until some time has passed
22:51:40 <doug16k> I might give up on that and go for full robustness when I reimplement my paging
22:51:43 --- quit: hmmmmm (Ping timeout: 264 seconds)
22:51:45 <klys> doug16k, how does a linear_addr as found on line 2350 make it past line 2369, where you printed it out and it's < 0?
22:51:56 --- join: hmmmm (~sdfgsf@pool-72-79-165-80.sctnpa.east.verizon.net) joined #osdev
22:53:16 <doug16k> it's declared in a higher scope at 2348
22:53:31 --- quit: hmmmmmm (Ping timeout: 264 seconds)
22:53:48 <doug16k> maybe I misunderstood
22:53:54 <klys> so those are unsigned?
22:54:01 --- join: hmmmmm (~sdfgsf@pool-72-79-163-166.sctnpa.east.verizon.net) joined #osdev
22:54:06 <klys> or wider than 64 bits?
22:54:14 --- quit: CrystalMath (Quit: Support Free Software - https://www.fsf.org/)
22:54:36 <doug16k> there are two ways to think of it
22:55:24 <doug16k> 1) signed, address space is from -128TB to +128TB. 2) unsigned, from 0 to 128TB is user space and the top 128TB is kernel space
22:56:15 <doug16k> 1 is a better mental model, because (char*)0 - 1 is actually the top byte of kernel space
22:56:39 <klys> is linear_addr unsigned?
22:57:12 <klys> ot
22:57:19 <klys> it's a linaddr_t
22:57:36 --- join: hmmmmmm (~sdfgsf@pool-72-79-165-221.sctnpa.east.verizon.net) joined #osdev
22:57:40 --- quit: hmmmm (Ping timeout: 268 seconds)
22:57:47 <doug16k> yes it is uintptr_t
22:58:16 <doug16k> doesn't make any difference though whether it is signed or unsigned
22:58:42 <doug16k> it could if I shifted right a linear address, but that never happens
22:58:42 <klys> well the assertion would fail were it signed and that's all I meant
22:58:54 --- quit: hmmmmm (Ping timeout: 268 seconds)
22:59:01 <doug16k> ah, exactly
22:59:10 --- join: hmmmmm (~sdfgsf@pool-72-79-166-153.sctnpa.east.verizon.net) joined #osdev
22:59:17 <doug16k> kernel addresses are > 0x100000
22:59:25 <doug16k> so yeah, it does matter :)
23:02:36 --- quit: hmmmmmm (Ping timeout: 268 seconds)
23:04:05 --- join: aalm (~aalm@37-219-139-128.nat.bb.dnainternet.fi) joined #osdev
23:04:13 --- quit: hmmmmm (Ping timeout: 240 seconds)
23:09:12 <klys> doug16k, have you been looking at line 2220 much
23:13:45 <doug16k> yes. I suspect something isn't right in there but it looks right
23:14:08 <doug16k> look at 2216. those are equal when the whole range is within a 2MB region...
23:14:37 <doug16k> oh wait a second
23:14:46 <klys> well you have to write your pte, pde, and pdpt. this range is well below 2 MiB.
23:15:11 <doug16k> 2216 says "is this whole region within a single 2MB range"?
23:15:34 <doug16k> if that is true, the following 3 lines say "are all the page tables present all the way up to the last level?"
23:15:42 <doug16k> if so, nothing to do
23:15:59 <doug16k> just return the pointer to the PT entry for the specified start address
23:16:46 <doug16k> but... you have the right idea though. if it ends up returning with that page not present, something's gotta be wrong in mm_create_pagetables_aligned
23:17:36 <doug16k> I can't see what though
23:18:14 <klys> if there is nothing to do, exactly why is that?
23:18:19 --- quit: Jari-- (Ping timeout: 240 seconds)
23:18:40 <doug16k> nothing to do because the page table it is "creating" is already created
23:18:44 --- join: hmmmm (~sdfgsf@pool-72-79-162-185.sctnpa.east.verizon.net) joined #osdev
23:19:44 <doug16k> let's say you want to map something at address X, with size Y. you call mm_create_pagetables_aligned(X, Y) and it returns a pointer to the PT entry for address X. then you just fill from X to X+(Y >> 12) with pages
23:19:47 <klys> what's a pte_t and how is pte_st[ 3 ] calculated?
23:19:50 <Ameisen> doug16k turns out dash was just screwing up a completely different way on my script
23:19:53 <Ameisen> and printing things that made no sense
23:19:56 <Ameisen> zsh handles it fine
23:20:07 <Ameisen> most of these scripts will be changed to ruby at some point ideally
23:20:20 <Ameisen> though I still want to make a scripting language called jewel
23:20:24 <Ameisen> mainly because the file extension will be fun
23:20:53 <doug16k> klys, pte_t is a uintptr_t - a page table entry
23:21:06 <doug16k> one of the 512 things in a page table
23:21:39 <doug16k> pte_st[3] is a pointer to the page table entry for address "start"
23:21:43 <klys> do you have a wiki page for 64-bit paging?
23:21:44 <doug16k> computed by line 2211
23:21:50 <Ameisen> I find it's sometimes nicer to use structures for that sort of thing
23:21:59 <Ameisen> or classes
23:22:26 <doug16k> Ameisen, I'm atomically updating the page tables though. bitfields would require a union and more screwing around
23:23:17 <Ameisen> use classes
23:23:18 <Ameisen> wrap that logic
23:23:31 --- quit: hmmmm (Ping timeout: 264 seconds)
23:23:38 <doug16k> yeah, constexpr and stuff right?
23:23:44 <doug16k> at first this was C code D:
23:23:44 --- join: clever_ (~clever@142.163.143.105) joined #osdev
23:24:27 --- quit: clever (Ping timeout: 240 seconds)
23:24:32 <doug16k> I didn't go rampaging through C++ifying everything
23:24:37 --- nick: clever_ -> clever
23:24:50 <doug16k> only stuff that benefited drastically
23:25:14 --- quit: clever (Changing host)
23:25:15 --- join: clever (~clever@unaffiliated/clever) joined #osdev
23:25:19 <Ameisen> need a script to automatically C++2a-ize everything
23:25:22 <Ameisen> C++AI
23:25:25 <doug16k> I have to hold myself back. if I let myself go the whole thing would be indecipherable template soup
23:25:39 <Ameisen> god I with this gnu stuff was consistent
23:25:47 <Ameisen> does this one use autoconf? who knows
23:26:18 <Ameisen> yes.
23:26:49 --- join: hmmmm (~sdfgsf@pool-72-79-160-229.sctnpa.east.verizon.net) joined #osdev
23:27:29 <doug16k> klys, I really appreciate you looking
23:27:39 <klys> sure
23:27:44 <doug16k> just knowing you are looking/looked will make me second guess my assumptions
23:29:32 <doug16k> it feels like a strategically placed dump of entire page tables + diffing not-crashed and crashed might find it
23:30:01 <doug16k> assuming the dump doesn't make it work every time
23:30:21 <Ameisen> I'm working on designing my build environment
23:30:26 <Ameisen> which should be able to run under NT or Linux
23:30:30 <Ameisen> which... is a little odd.
23:31:11 <bcos_> WSL?
23:31:24 <doug16k> Ameisen, bare cmd?
23:32:35 <doug16k> gnu make would spawn cmd for each command on NT right?
23:33:04 <doug16k> or directly spawn the tool executable, of course
23:33:19 --- quit: hmmmm (Ping timeout: 240 seconds)
23:36:37 <klys> a pte is 128 bits, I suppose
23:36:51 <klys> which makes me wonder how you can have 4 64-bit elements
23:37:02 <doug16k> it's 64 bits
23:37:19 <klys> so, you have 4 16-bit elements
23:37:35 <doug16k> no
23:37:43 <doug16k> 4 different 64 bit entries
23:37:52 <klys> so, it's 256 bits
23:37:58 <doug16k> no
23:38:06 <doug16k> PML4 entry tells it the physical address of the PDPT page
23:38:07 --- join: stoopkid (uid137696@gateway/web/irccloud.com/x-tvwgtcvmabrtqavq) joined #osdev
23:38:15 <doug16k> PDPT entry tells it the physical address of the PD page
23:38:26 <doug16k> PD entry tells it the physical address of the PT page
23:38:32 <graphitemaster> Ameisen, haven't you herd, C++ is dead
23:38:33 <klys> ^
23:38:34 <doug16k> PT entry maps the actual memory page
23:39:10 <doug16k> the index into PML4 page is address[47:39]
23:39:23 <doug16k> the index into PDPT page is address[38:30]
23:39:36 <doug16k> the index into the PD page is address[29:21]
23:39:53 <doug16k> the index into the PT page is address[20:12]
23:40:26 <doug16k> 9 bits of the address at each level. 2^9 = 512
23:40:52 <klys> 4096 / 512 = 64 bit pte
23:40:56 --- quit: froggey (Ping timeout: 264 seconds)
23:41:01 <doug16k> yes
23:41:06 <klys> 4 16-bit entries
23:41:08 <geist> a picture speaks a thousand words
23:41:11 <doug16k> no
23:41:17 --- join: absolute123 (~vodka@185.192.189.222) joined #osdev
23:41:22 <klys> [ 3 ] is 16-bit?
23:41:49 <doug16k> the mapping for any given 4KB mapping is 4 64 bit page table entries
23:41:57 <doug16k> the first 3 are just the path to the page table page
23:42:09 <doug16k> the 4th level maps the actual page
23:42:18 <geist> ah so the recursion thing is still going on
23:42:24 <geist> i stepped away for a bit
23:42:40 <doug16k> klys seems to think a PTE is 16+16+16+16 bits
23:42:46 <doug16k> because 64
23:43:03 <doug16k> it's 4 entire 64 bit entries in 4 different pages
23:43:16 <klys> ok
23:43:48 <doug16k> it = a path to a page in x86_64 paging
23:44:09 <doug16k> again, the first 3 levels are just a path to the actual page table that maps 512 4KB pages
23:44:37 <doug16k> it allows terabytes of space to be unmapped without taking up memory
23:44:41 <klys> entries 0 1 and 2 are present, so entry 3 must be...
23:45:17 <doug16k> yeah level 0 1 and 2 are present so the page that maps 512 4KB pages for that 2MB region is present
23:45:43 <doug16k> i.e. it is seeing of that page table page is present already
23:46:20 <absolute123> well well, again satellites are being talked about as possible targets for hobby os's. grrr..
23:46:40 <doug16k> in other words, if level 0 1 and 2 are present, and the entire region being instantiated is within that one 2MB region, then it created that page table already and there's nothing to do
23:47:24 --- join: froggey (~froggey@unaffiliated/froggey) joined #osdev
23:47:38 <doug16k> or more precisely, if the entry in level 0 is present and the entry in level 1 is present and the entry in level 2 is present, then the page table page at level 3 is present
23:48:08 <klys> idgi
23:48:10 <klys> :)
23:48:19 --- join: comero (uid257923@gateway/web/irccloud.com/x-wgalvzrdcjmqcfxj) joined #osdev
23:48:43 <absolute123> i did look at the hw code during today (last free day) , i can't see issues --- but as it is tough code -- it could be possible that i read it incorrect even though not entirely likely
23:48:47 <doug16k> I'm tryin' :D
23:49:07 <absolute123> for that sake i think i need to simulative runs on the verilog
23:49:16 <klys> the page table entry in 0 is present, the page table entry in 1 is present, etc, etc...
23:49:44 <klys> they are page table entries?
23:50:32 <doug16k> imagine an address. take that address and split it into 4 parts. these bit ranges -> 47:39, 38:30, 29:21, 20:12
23:51:01 <doug16k> you lookup the index selected by 47:39 in level 0 (the PML4)
23:51:24 <doug16k> you read that physical address. that address is the address of the next level. call it PDPT
23:51:28 <klys> so I see you have a function ptes_from_addr() and that gives you the four entries to the goal?
23:51:33 <doug16k> yes
23:51:55 <doug16k> 4 pointers to those entries, to be precise
23:52:33 <klys> yet it is obvious from your bug report that pte_st[ 3 ] was not present, and I only see one other possibility.
23:52:51 <doug16k> pte_st[2] would be the not present one
23:53:01 <doug16k> it failed to write an entry to pte_st[3]
23:53:13 <doug16k> pte_st[3] is the place in memory where the 4KB pte is
23:53:19 <klys> ok
23:53:39 <doug16k> to *pte_st[3] actually
23:53:49 <doug16k> as in *pte_st[3] = foo
23:53:52 <klys> we make a little more sense, yet it is returning pte[ 3 ] which hasn't been dereferenced yet.
23:53:55 <doug16k> pte_st[3] is a pointer
23:54:17 <doug16k> right
23:54:27 <doug16k> and line 2219 just made sure it was present
23:54:41 <doug16k> which is why I'm stuck/baffled
23:55:10 <doug16k> but that assumes it was fastpathed
23:55:18 <doug16k> it might make it to the loop at 2233
23:55:42 <doug16k> which populates level 0 1 2 and the loop can't exit early
23:56:19 <klys> how about a couple of braces and an assert that you can dereference the address?
23:56:45 <doug16k> I'll try it
23:56:53 --- join: spare (~user@unaffiliated/spareproject) joined #osdev
23:58:09 <doug16k> assert(*pte_st[3] != 0xFEEDBEEFFACEF00D);
23:58:19 <absolute123> the biggest confusion is , when it needs to run a parallel array that is bigger than available registers used, i.e on kernel with 24 regs with 10warps, the num_records being bigger than 24
23:58:48 <absolute123> not sure what would happen then
23:59:29 <klys> wait, absolute123, are you trying to confuse someone?
23:59:51 <bcos_> doug16k: Still bug hunting?
23:59:56 <absolute123> klys: why should i?
23:59:59 --- log: ended osdev/18.07.14