Search logs:

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=1&d=16

Tuesday, 16 January 2018

00:00:00 --- log: started osdev/18.01.16
00:00:52 --- quit: user10032 (Remote host closed the connection)
00:01:34 --- quit: Belxjander (Ping timeout: 265 seconds)
00:07:09 --- join: Belxjander (~Belxjande@sourcemage/Mage/Abh-Elementalist) joined #osdev
00:12:14 --- join: xerpi (~xerpi@254.red-88-23-232.staticip.rima-tde.net) joined #osdev
00:13:01 --- quit: xerpi (Remote host closed the connection)
00:13:21 --- join: xerpi (~xerpi@254.red-88-23-232.staticip.rima-tde.net) joined #osdev
00:14:46 --- quit: caen23 (Ping timeout: 248 seconds)
00:17:26 --- quit: sdfgsdfg (Killed (Sigyn (Spam is off topic on freenode.)))
00:19:50 --- join: bm371613 (~bartek@2a02:a317:603f:9800:391:ed9f:1c09:1285) joined #osdev
00:22:54 --- join: m_t (~m_t@p57B3C5BF.dip0.t-ipconnect.de) joined #osdev
00:24:49 --- quit: mniip (Ping timeout: 240 seconds)
00:28:39 --- quit: Tazmain (Ping timeout: 248 seconds)
00:29:09 --- join: mniip (mniip@unaffiliated/mniip) joined #osdev
00:30:30 --- join: caen23 (~caen23@79.118.94.187) joined #osdev
00:43:42 --- join: Tazmain (~Tazmain@41.189.78.208) joined #osdev
00:43:51 --- quit: Tazmain (Changing host)
00:43:51 --- join: Tazmain (~Tazmain@unaffiliated/tazmain) joined #osdev
00:52:26 --- join: Darmor (~Tom@198-91-187-5.cpe.distributel.net) joined #osdev
00:53:20 --- join: regreg_ (~regreg@85.121.54.224) joined #osdev
00:56:18 --- quit: regreg__ (Ping timeout: 255 seconds)
01:06:39 --- quit: dhoelzer (Ping timeout: 255 seconds)
01:06:49 --- quit: Belxjander (Ping timeout: 240 seconds)
01:07:50 --- join: Belxjander (~Belxjande@sourcemage/Mage/Abh-Elementalist) joined #osdev
01:07:51 --- join: kimundi (~Kimundi@dynip-129-217-074-227.wifi.tu-dortmund.de) joined #osdev
01:10:41 --- join: regreg (~regreg@85.121.54.224) joined #osdev
01:12:57 --- quit: regreg_ (Ping timeout: 240 seconds)
01:33:50 --- quit: sinetek (Quit: This computer has gone to sleep)
01:41:18 --- quit: Lowl3v3l (Remote host closed the connection)
01:42:48 --- join: Lowl3v3l (~Lowl3v3l@141.35.23.133) joined #osdev
01:43:44 --- join: nzoueidi (~nzoueidi@ubuntu/member/na3il) joined #osdev
01:45:47 --- quit: quc (Ping timeout: 256 seconds)
01:48:36 <gamozo> what what is L1OM?
01:48:42 --- join: listenmore (~strike@2.27.123.231) joined #osdev
01:49:08 --- join: farb (~farb@185.47.61.163) joined #osdev
01:49:08 --- quit: farb (Changing host)
01:49:08 --- join: farb (~farb@unaffiliated/farb) joined #osdev
01:49:38 <gamozo> first gen xeon phi?
01:52:08 <bcos_> Sounds unlikely
01:52:20 <bcos_> Where did you see "L1OM"?
01:53:35 <gamozo> it is :\
01:53:37 <gamozo> sandpile opcode enc
01:53:44 <gamozo> "L1OM misc and L1OM vector"
01:53:47 <gamozo> which is part of K1OM
01:53:51 <gamozo> which is xeon phi first gen
01:54:03 <moondeck[m]> https://software.intel.com/en-us/forums/intel-many-integrated-core/topic/536316
01:54:04 <geist> knights landing, i guess
01:54:08 <bslsk05> ​software.intel.com: How to disassemble with objdump for programs running on mic
01:54:17 <gamozo> knights corner was first gen
01:54:20 <gamozo> knights landing is EVEX
01:54:22 <geist> er that.
01:54:43 <gamozo> alright, so i don't need to support that, phew
01:54:44 <bcos_> Wasn't there something in between larabee and knight's corner?
01:54:52 <gamozo> not sure
01:55:08 <gamozo> cause I thought KNC was MVEX, but maybe it was only partially MVEX
01:55:14 <bcos_> Ah - wikipedia - knight's ferry
01:55:15 <gamozo> but yeah, it could be something inbetween
02:01:21 --- quit: xerpi (Quit: Leaving)
02:01:30 --- quit: hmmmm (Remote host closed the connection)
02:03:04 --- quit: k4m1 (Quit: brb)
02:17:31 --- quit: regreg (Ping timeout: 256 seconds)
02:21:44 --- quit: immibis (Ping timeout: 256 seconds)
02:29:51 --- join: Kimundi_ (~Kimundi@dynip-129-217-074-227.wifi.tu-dortmund.de) joined #osdev
02:30:09 --- quit: kimundi (Remote host closed the connection)
02:31:56 --- quit: daniele_athome (Ping timeout: 256 seconds)
02:32:25 --- join: daniele_athome (~daniele_a@93-40-14-81.ip36.fastwebnet.it) joined #osdev
02:35:25 --- join: dhoelzer (~dhoelzer@ool-4a5940e5.dyn.optonline.net) joined #osdev
02:43:48 --- join: k4m1 (~k4m1@82-181-0-34.bb.dnainternet.fi) joined #osdev
02:50:36 --- join: Kimundi__ (~Kimundi@dhl1116.cs.uni-dortmund.de) joined #osdev
02:50:49 --- quit: Kimundi_ (Ping timeout: 240 seconds)
03:09:39 --- quit: darklink (Ping timeout: 256 seconds)
03:11:55 --- join: darklink (~darklink@unaffiliated/darklink) joined #osdev
03:13:54 --- quit: Humble (Ping timeout: 276 seconds)
03:22:30 --- join: bcos (~bcos@CPE-101-103-18-5.lnse1.fli.bigpond.net.au) joined #osdev
03:25:27 --- quit: bcos_ (Ping timeout: 240 seconds)
03:49:06 --- join: lldd (~n@129.79.117.91.dynamic.reverse-mundo-r.com) joined #osdev
03:52:42 --- quit: Darmor (Ping timeout: 255 seconds)
03:53:07 --- join: Darmor (~Tom@198-91-187-5.cpe.distributel.net) joined #osdev
04:03:57 --- quit: caen23 (Ping timeout: 276 seconds)
04:18:30 --- quit: k4m1 (Quit: bbl)
04:19:23 --- join: uvgroovy (~uvgroovy@c-65-96-163-219.hsd1.ma.comcast.net) joined #osdev
04:20:31 --- join: vmlinuz (~vmlinuz@32.104.18.203) joined #osdev
04:20:31 --- quit: vmlinuz (Changing host)
04:20:31 --- join: vmlinuz (~vmlinuz@unaffiliated/vmlinuz) joined #osdev
04:21:20 --- quit: uvgroovy (Client Quit)
04:21:36 --- join: uvgroovy (~uvgroovy@c-65-96-163-219.hsd1.ma.comcast.net) joined #osdev
04:21:52 --- part: ebrasca left #osdev
04:23:42 --- join: Arcaelyx (~Arcaelyx@2601:646:c200:27a1:b885:c1a6:864:b96d) joined #osdev
04:29:06 --- join: caen23 (~caen23@79.118.94.187) joined #osdev
04:32:40 --- join: vaibhav (~vnagare@125.16.97.112) joined #osdev
04:33:27 --- quit: caen23 (Ping timeout: 240 seconds)
04:35:30 --- join: caen23 (~caen23@79.118.94.187) joined #osdev
04:40:07 --- quit: caen23 (Ping timeout: 260 seconds)
04:45:04 --- join: caen23 (~caen23@79.118.94.187) joined #osdev
04:56:45 --- quit: alyptik (Ping timeout: 256 seconds)
04:57:46 --- join: alyptik (ayy@cpe-76-173-133-37.hawaii.res.rr.com) joined #osdev
05:02:27 --- quit: awang (Ping timeout: 255 seconds)
05:13:50 --- join: garit (~garit@unaffiliated/garit) joined #osdev
05:22:24 --- join: awang (~awang@rrcs-24-106-163-46.central.biz.rr.com) joined #osdev
05:27:41 --- quit: abra0 (Quit: laters)
05:27:54 --- quit: babyflakes (Quit: Connection closed for inactivity)
05:28:43 --- quit: shymega (Ping timeout: 255 seconds)
05:28:54 --- quit: ephemer0l (Ping timeout: 248 seconds)
05:28:55 --- quit: aiwakura (Ping timeout: 264 seconds)
05:30:10 --- join: aiwakura (~aiwakura@163.172.213.86) joined #osdev
05:31:19 --- quit: talin (Ping timeout: 240 seconds)
05:31:47 --- join: abra0 (moo@unaffiliated/abra0) joined #osdev
05:32:18 --- join: talin (~talin@hydra.org) joined #osdev
05:32:42 --- nick: talin -> Guest25935
05:43:11 --- quit: qeos|2 (Read error: Connection reset by peer)
05:43:34 --- join: qeos|2 (~qeos@ppp158-255-171-31.pppoe.spdop.ru) joined #osdev
05:44:40 --- quit: AntiSpamMeta (Remote host closed the connection)
05:44:53 --- join: AntiSpamMeta (asm@AntiSpamMeta/.) joined #osdev
05:45:28 --- join: shymega (~shymega@torbaytechjam/shymega) joined #osdev
05:48:48 --- quit: Guest25935 (Quit: Changing server)
05:48:55 --- join: talin_ (~talin@hydra.org) joined #osdev
05:52:48 --- quit: brynet (Quit: leaving)
05:54:57 --- quit: shymega (Quit: Peace out.)
05:55:09 --- quit: Lowl3v3l (Remote host closed the connection)
05:56:44 --- join: Lowl3v3l (~Lowl3v3l@141.35.23.133) joined #osdev
05:58:00 --- join: shymega (~shymega@torbaytechjam/shymega) joined #osdev
05:59:06 --- join: brynet (~brynet@brynet6.biz.tm) joined #osdev
06:02:27 --- join: Humble (~hchiramm@2405:204:578f:ac29:33ff:a16b:b676:fdd3) joined #osdev
06:03:37 --- quit: aiwakura (Quit: Ping timeout (120 seconds))
06:04:50 --- join: aiwakura (~aiwakura@163.172.213.86) joined #osdev
06:06:18 --- quit: lonjil (Remote host closed the connection)
06:06:29 --- join: lonjil (~quassel@2a02:418:6050:ed15:ed15:ed15:e741:32d6) joined #osdev
06:08:27 --- quit: uvgroovy (Ping timeout: 240 seconds)
06:12:49 --- quit: Lowl3v3l (Remote host closed the connection)
06:14:35 --- quit: lonjil (Remote host closed the connection)
06:14:43 --- join: lonjil (~quassel@2a02:418:6050:ed15:ed15:ed15:e741:32d6) joined #osdev
06:25:19 --- join: sgautam (~sgautam@59.182.251.83) joined #osdev
06:25:34 --- join: adminseodwn (~archer@unaffiliated/remcwo9o) joined #osdev
06:25:39 --- join: SwiftMatt (~Objective@2601:282:4300:3e:d444:fbfb:a6a3:4788) joined #osdev
06:26:53 --- quit: sgautam (Client Quit)
06:29:05 --- quit: Tazmain (Quit: Leaving)
06:32:11 --- join: lowl3v3l (~lowl3v3l@i5E86D8CD.versanet.de) joined #osdev
06:32:22 --- quit: brynet (Quit: leaving)
06:36:28 --- join: JusticeEX (~justiceex@pool-108-30-196-198.nycmny.fios.verizon.net) joined #osdev
06:39:43 --- join: brynet (~brynet@brynet6.biz.tm) joined #osdev
06:51:34 --- quit: rain1 (Ping timeout: 248 seconds)
06:56:17 --- quit: lowl3v3l (Remote host closed the connection)
06:57:18 --- join: John_Ivan (~John_Ivan@unaffiliated/john-ivan/x-3287162) joined #osdev
07:01:21 --- quit: SwiftMatt (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
07:01:48 --- quit: lldd (Quit: Leaving)
07:06:48 --- join: NotSecwitter (~NonSecwit@unaffiliated/nonsecwitter) joined #osdev
07:10:22 --- join: baschdel (~baschdel@2a01:5c0:13:b41:3f94:523d:e882:ef01) joined #osdev
07:11:49 --- join: hmmmm (~sdfgsf@pool-72-79-165-92.sctnpa.east.verizon.net) joined #osdev
07:22:42 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
07:24:52 --- join: babyflakes (uid171740@gateway/web/irccloud.com/x-knbyeginlrlqnyfp) joined #osdev
07:25:38 --- join: ephemer0l_ (~ephemer0l@pentoo/user/ephemer0l) joined #osdev
07:27:02 --- quit: ohnx (Remote host closed the connection)
07:29:48 --- quit: NotSecwitter (Quit: KVIrc 4.9.2 Aria http://www.kvirc.net/)
07:36:08 --- quit: xenos1984 (Quit: Leaving.)
07:44:56 --- join: doug16k (~dougx@174-138-193-47.cpe.distributel.net) joined #osdev
07:48:42 --- quit: alphawarrior (Quit: ZNC 1.6.3+deb1 - http://znc.in)
07:55:30 --- quit: dave24 (Quit: rirc v0.1)
07:57:29 --- join: xenos1984 (~xenos1984@22-164-191-90.dyn.estpak.ee) joined #osdev
08:01:39 --- join: regreg (~regreg@85.121.54.224) joined #osdev
08:04:08 --- join: eivarv (~eivarv@cm-84.215.4.97.getinternet.no) joined #osdev
08:04:58 --- join: Kimundi_ (~Kimundi@dynip-129-217-074-227.wifi.tu-dortmund.de) joined #osdev
08:07:58 --- quit: Kimundi__ (Ping timeout: 256 seconds)
08:10:07 --- quit: Kimundi_ (Ping timeout: 260 seconds)
08:17:19 --- join: dave24 (~rirc_v0.1@92.207.128.213) joined #osdev
08:24:39 --- quit: Arcaelyx (Quit: Textual IRC Client: www.textualapp.com)
08:27:49 --- join: kimundi (~Kimundi@dhl1116.cs.uni-dortmund.de) joined #osdev
08:28:16 --- quit: kimundi (Remote host closed the connection)
08:28:33 --- join: kimundi (~Kimundi@dhl1116.cs.uni-dortmund.de) joined #osdev
08:29:42 --- quit: nsh (Quit: ZNC - http://znc.in)
08:35:08 --- join: nsh (~lol@wikipedia/nsh) joined #osdev
08:38:37 --- join: Asu (~sdelang@AMarseille-658-1-97-215.w86-219.abo.wanadoo.fr) joined #osdev
08:41:33 --- quit: uvgroovy (Remote host closed the connection)
08:41:37 --- quit: sprocklem (Ping timeout: 260 seconds)
08:41:44 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
08:42:46 --- quit: kimundi (Remote host closed the connection)
08:43:38 --- join: kimundi (~Kimundi@dhl1116.cs.uni-dortmund.de) joined #osdev
08:45:53 --- quit: John_Ivan (Read error: Connection reset by peer)
08:52:50 --- join: rain1 (~user@unaffiliated/rain1) joined #osdev
08:53:10 --- quit: kimundi (Ping timeout: 248 seconds)
08:54:23 --- join: kimundi (~Kimundi@dynip-129-217-074-227.wifi.tu-dortmund.de) joined #osdev
09:00:14 --- quit: Darmor (Quit: Leaving)
09:00:48 --- join: SwiftMatt (~Objective@2601:282:4300:3e:8c6b:1d97:1b84:3207) joined #osdev
09:03:49 --- quit: kimundi (Ping timeout: 256 seconds)
09:07:52 --- join: vdamewood (~vdamewood@unaffiliated/vdamewood) joined #osdev
09:12:54 --- quit: doug16k (Read error: Connection reset by peer)
09:13:20 --- join: doug16k (~dougx@174-138-193-47.cpe.distributel.net) joined #osdev
09:16:32 --- quit: bm371613 (Quit: Konversation terminated!)
09:16:38 --- quit: nzoueidi (Ping timeout: 248 seconds)
09:17:16 --- join: Tazmain (~Tazmain@unaffiliated/tazmain) joined #osdev
09:23:12 --- quit: daniele_athome (Ping timeout: 265 seconds)
09:24:06 --- join: daniele_athome (~daniele_a@93-40-14-81.ip36.fastwebnet.it) joined #osdev
09:29:50 --- join: raphaelsc (~raphaelsc@179.179.253.44) joined #osdev
09:36:52 --- join: kimundi (~Kimundi@p57A89BB1.dip0.t-ipconnect.de) joined #osdev
09:38:44 --- join: user10032 (~Thirteen@90.199.199.77) joined #osdev
09:45:26 --- quit: oaken-source (Ping timeout: 256 seconds)
09:47:43 --- join: freakazoid0223 (~IceChat9@pool-108-52-4-148.phlapa.fios.verizon.net) joined #osdev
09:48:00 --- join: Barrett (~barrett@unaffiliated/barrett) joined #osdev
09:56:53 --- join: freakazoid0223_ (~IceChat9@pool-108-52-4-148.phlapa.fios.verizon.net) joined #osdev
09:58:45 --- quit: freakazoid0223 (Ping timeout: 248 seconds)
09:58:49 --- quit: listenmore (Ping timeout: 240 seconds)
10:02:06 --- join: FreeFull (~freefull@defocus/sausage-lover) joined #osdev
10:02:30 --- quit: mischief (Ping timeout: 248 seconds)
10:02:41 --- join: mischief (~none@iota.offblast.org) joined #osdev
10:09:11 --- quit: SwiftMatt (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
10:14:40 --- join: svk (~svk@p2003006A650E5F00BD182BF0459F3C29.dip0.t-ipconnect.de) joined #osdev
10:18:05 --- join: fujisan (uid4207@gateway/web/irccloud.com/x-bwlfeykqvprjlqum) joined #osdev
10:20:31 --- join: bauen1 (~bauen1@ip5f5bfcbd.dynamic.kabel-deutschland.de) joined #osdev
10:22:22 --- quit: bauen1 (Client Quit)
10:25:53 --- quit: JusticeEX (Ping timeout: 268 seconds)
10:31:11 --- join: JusticeEX (~justiceex@pool-108-30-196-198.nycmny.fios.verizon.net) joined #osdev
10:33:46 --- join: sprocklem (~sprocklem@unaffiliated/sprocklem) joined #osdev
10:41:40 --- quit: vdamewood (Quit: Textual IRC Client: www.textualapp.com)
10:46:47 --- quit: JusticeEX (Ping timeout: 248 seconds)
10:52:56 --- join: harukomoto (~harukomot@93-41-17-101.ip79.fastwebnet.it) joined #osdev
10:56:55 --- quit: garit (Ping timeout: 248 seconds)
10:57:55 --- quit: uvgroovy (Quit: uvgroovy)
10:59:13 --- join: tacco\unfoog (~tacco@dslb-088-064-173-052.088.064.pools.vodafone-ip.de) joined #osdev
11:00:13 --- join: sinetek (~sinetek@modemcable018.210-57-74.mc.videotron.ca) joined #osdev
11:03:24 --- quit: sinetek (Client Quit)
11:07:13 --- quit: Barrett (Read error: Connection reset by peer)
11:09:25 --- quit: voidah (Quit: Leaving)
11:14:18 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
11:15:54 --- quit: uvgroovy (Client Quit)
11:20:29 --- join: sinetek (~sinetek@modemcable018.210-57-74.mc.videotron.ca) joined #osdev
11:20:37 --- quit: sinetek (Client Quit)
11:24:06 --- join: b0l_ (4dac8cd3@gateway/web/freenode/ip.77.172.140.211) joined #osdev
11:25:57 --- quit: Humble (Ping timeout: 276 seconds)
11:30:12 --- join: quc (~quc@host-89-230-165-217.dynamic.mm.pl) joined #osdev
11:38:45 <kimundi> Hi! As part of a university course I'm writing a small x86_64 OS. As part of a extension, I want to enable floating point support in it, but the provided code framework does not have any support enabled for it per default - which means I get a illigal instruction interrupt as soon as I just define a floating point variable
11:39:32 <kimundi> I've tried looking at the osdev wiki of what is involved, but I could not yet find clear concise instructions
11:41:02 <bcos> "floating point" is either the FPU, SSE, or AVX; where each different extension is enabled differently
11:41:12 <kimundi> As far as I know, I need help with 1) enabling all relevant hardware support in the startup assembler file 2) saving the correct floating point registers during an interrupt 3) saving the correct floating point registers during a context switch (2 and 3 are independent mechanisms in this codebase)
11:41:31 --- join: ohnx (~ohnx@unaffiliated/ohnx) joined #osdev
11:42:57 <kimundi> bcos: Either would be fine with me, I don't need fancy support for simd or stuff like that - I just want floats, the basic arithmetic operators, and a few special operations like sin/cos/sqrt
11:43:34 <kimundi> If there is a gcc compiler flag I can/should set to make it behave better, or just pick a simpler subset of the hardware support during codegen, that would help to know too :)
11:43:54 <doug16k> kimundi, all x86_64 operating systems use sse
11:43:57 <kimundi> I can provide links to my OS code/the startup assembler file if it help
11:45:20 <bcos> kimundi: Probably begin here: http://wiki.osdev.org/SSE#Adding_support
11:45:21 <bslsk05> ​wiki.osdev.org: SSE - OSDev Wiki
11:45:30 <bcos> ..then read the CPU's manuals :-)
11:45:32 <doug16k> see the intel manual, look up the control registers. CR4 has two bits that enable sse: OFXSR and OSXMMEX. if they aren't set, the CPU will treat all SSE instructions as invalid opcodes.
11:45:40 <kimundi> doug16k: Yeah, afaik its mandated per specification - but the code we have doesn't initialize it. I have added a bit of assembler from the osdev wiki for enabling sse, but I don't know if its correct
11:46:18 <doug16k> so save and restore state, you need to use at least fxstor and fxrstor, which saves the x87 FPU state and the 128-bit SSE registers
11:46:53 <kimundi> Yeah, that piece of code is what I added
11:48:00 <kimundi> https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-6/startup.asm#L426
11:48:02 <bslsk05> ​github.com: oostubs-temp/startup.asm at marvin-aufgabe-6 · Kimundi/oostubs-temp · GitHub
11:49:33 <doug16k> kimundi, that looks like it would work. can you show the fxsave/fxrstor code?
11:51:32 <doug16k> kimundi, do you realize that reading/writing the low 16 or 32 bits of a register truncates the high 32 bits?
11:51:40 <doug16k> you should use rax there, not ax
11:51:58 <doug16k> and extend that mask to 64 bits wide
11:52:24 <kimundi> doug16k: So, there are two different places where the code is saving registers - once for interrupts, and once for switching coroutines - I'll link both, afaik only one of those uses the fstore/fload instructions, and our tutor said that we shouldn't trust in it being correct
11:53:13 <kimundi> This is the interrupt handler: https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-6/startup.asm#L251
11:53:15 <bslsk05> ​github.com: oostubs-temp/startup.asm at marvin-aufgabe-6 · Kimundi/oostubs-temp · GitHub
11:53:21 <doug16k> the fxsave/fxrstor operand is required be 512-bit aligned
11:53:38 <bcos> Much better to make sure IRQs (and possible entire kernel) don't use SSE/AVX to avoid the massive cost of saving/loading their state very often
11:53:55 <kimundi> And this is the corotine context switch: https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-6/machine/toc.asm#L48
11:53:56 <bslsk05> ​github.com: oostubs-temp/toc.asm at marvin-aufgabe-6 · Kimundi/oostubs-temp · GitHub
11:54:24 <doug16k> those are old save/restore instructions. you should use fxsave/fxrstor
11:54:44 <doug16k> also, it won't work at all as shown
11:54:57 <kimundi> doug16k: > do you realize that reading/writing the low 16 or 32 bits of a register truncates the high 32 bits?: I'm barely comprehending what the assembler code is doing, its not really a focus of the course, so if there are any mistakes or weirdness, please tell me :)
11:55:01 <doug16k> oh wait, it might
11:55:39 <doug16k> on long mode x86_64, any time the destination of an instruction is an 8, 16, or 32 bit register, it truncates the high 32 bits to zero
11:55:59 <olsner> no, only 32-bit writes do that
11:56:07 <olsner> 8- and 16-bit accesses preserve the other bits
11:56:27 <kimundi> bcos: Hm true - we would only use the float stuff in a user process, so you think it would work if we don't touch the registers for interrupts, and only for context switches?
11:56:32 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
11:57:06 <bcos> kimundi: That's how most OSs do it (except for special cases where SSE/AVX helps a lot)
11:57:10 --- quit: vmlinuz (Quit: Leaving)
11:57:45 <kimundi> Our tutor also said it might work if we just have a single process do floating point calculation, since then it doesn't matter if context switching does not swap the registers out, but I'd like to at least know how to do it correctly
11:57:54 --- quit: uvgroovy (Client Quit)
11:58:03 <doug16k> kimundi, is "guardian" compiled code?
11:58:05 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
11:58:23 <kimundi> yes, a C function that handles the interrupts
11:58:24 <kimundi> sec
11:58:40 <kimundi> https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-6/guard/guardian.cc
11:58:42 <bslsk05> ​github.com: oostubs-temp/guardian.cc at marvin-aufgabe-6 · Kimundi/oostubs-temp · GitHub
11:58:59 <doug16k> if you are going to skip saving/restoring sse state there, you need to make sure the compiler knows it can't touch the sse or fpu state
11:59:11 <kimundi> doug16k: Yeah, thats the tricky part
11:59:20 <kimundi> So I'd rather just store them correctly :)
12:00:27 <doug16k> the simplest way is to move rsp to a call preserved register (rbx,rbp,r12-r15) and sub rsp,512, then and rsp,-512 then fxsave [rsp]
12:00:37 <bcos> Might be useful to get "only single process uses floating point" working first (to make sure the initialisation works); and then add state save/restore to task switches after you know the initialisation works
12:01:11 <doug16k> then when that function returns, fxrstor [rsp] then mov that call preserved register to rsp, then continue with what you have
12:01:26 --- quit: sprocklem (Ping timeout: 248 seconds)
12:02:34 <doug16k> the other way is to use -mgeneral-regs-only when compiling the c++ code, to ban it from touching sse/fpu
12:02:35 <b0l_> GDT is set before the SMP setup, if GDT is unique per system, how other cores know the gdt address on mem?
12:02:59 <doug16k> b0l_, you have to set up every cpu
12:03:25 <kimundi> doug16k: Hm, that flags sounds like a easy fix too - does that prevent me from doing floating point operations?
12:03:32 <doug16k> yes
12:03:33 <b0l_> so the same gdt is setup on all cores/cpus during the smp setup
12:03:52 <kimundi> doug16k: nvmd then :)
12:03:54 <doug16k> b0l_, usually the same, yes you must set up each cpu
12:04:01 <b0l_> ok
12:04:12 <b0l_> same for LDT?
12:04:31 <doug16k> b0l_, same for everything. the other cpus don't magically change because you set it for one cpu
12:04:47 <b0l_> eheh, right
12:05:03 <kimundi> doug16k: The context switching code uses this struct for holding the register state: https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-6/machine/toc.h
12:05:04 <bslsk05> ​github.com: oostubs-temp/toc.h at marvin-aufgabe-6 · Kimundi/oostubs-temp · GitHub
12:05:22 <doug16k> b0l_, GDT, LDT, IDT, all of the control registers, TSS, you name it.
12:05:33 <kimundi> doug16k: If understand you right, I should extend that last field to 512 bytes, and use the fx load/store instructions?
12:05:39 <doug16k> sorry, TR, not tss
12:05:49 <kimundi> DO I also need to somehow ensure the alignment fo 16 bytes there?
12:05:54 <b0l_> what is TR?
12:06:10 --- join: listenmore (~strike@2.27.123.231) joined #osdev
12:07:37 <doug16k> kimundi, yes, it must be aligned on a 16 byte boundary, and the size of the fxsave data is 512 bytes
12:08:03 --- quit: kimundi (Read error: Connection reset by peer)
12:08:04 <doug16k> oops, earlier I meant: sub rsp,512, then and rsp,-16 then fxsave [rsp]
12:08:28 <doug16k> oh but you aren't saving it on the stack, sorry
12:08:45 --- join: kimundi (~Kimundi@p57A89BB1.dip0.t-ipconnect.de) joined #osdev
12:08:45 <doug16k> you must set up that structure where you save the state so the fxsave area is 16 byte aligned
12:10:46 <doug16k> kimundi, yes, fxsave/fxrstor saves/restores the x87 state (old FPU) and the sse registers
12:10:50 --- join: bauen1 (~bauen1@ip5f5bfcbd.dynamic.kabel-deutschland.de) joined #osdev
12:12:09 <doug16k> the registers, the mxcsr, the floating point control word, everything to do with fpu and sse
12:12:12 <kimundi> doug16k: Sorry, my connection dropped, "you must set up that structure where you save the state so the fxsave area is 16 byte aligned" is the first what got through again
12:12:35 <doug16k> <doug16k> kimundi, yes, fxsave/fxrstor saves/restores the x87 state (old FPU) and the sse registers
12:12:57 <doug16k> <doug16k> the registers, the mxcsr, the floating point control word, everything to do with fpu and sse
12:13:39 --- quit: baschdel (Ping timeout: 256 seconds)
12:13:47 <kimundi> Okay, thanks :) SO I guess I have to figure out how to make sure the filed of this struct is 16 byte aligned...
12:16:24 <doug16k> kimundi, if it is C++11 code, it is as easy as putting alignas(16) before the type
12:17:06 <kimundi> doug16k: C++17 even - the issue is that assembler code wants to access it, and I'm not sure how to compute the correct aligned address then
12:17:15 <kimundi> Eg, there is this file: https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-6/machine/toc.inc
12:17:16 <doug16k> just get the rdi offset right and you're good
12:17:16 <bslsk05> ​github.com: oostubs-temp/toc.inc at marvin-aufgabe-6 · Kimundi/oostubs-temp · GitHub
12:17:59 <doug16k> put .align 16 before line 32 there
12:18:18 <kimundi> thanks!
12:19:24 <doug16k> b0l_, TR is the register that gets loaded when you ltr a TSS descriptor
12:20:10 <doug16k> b0l_, it holds the base and limit of the TSS
12:20:51 <doug16k> b0l_, usually each CPU needs a different TSS as well, since it doesn't make sense for multiple CPUs to share the same kernel stack
12:21:12 --- quit: ohnx (Ping timeout: 255 seconds)
12:21:50 --- join: ohnx (~ohnx@unaffiliated/ohnx) joined #osdev
12:21:55 <kimundi> doug16k: In toc.inc I changed the line 32 to ".align 16 fpu_offset: resb 512", and I get "machine/toc.inc:32: error: parser: instruction expected" - maybe wrong assembler syntax? Its using nasm
12:22:25 <doug16k> oh nasm, sorry. I think it is [align 16] in nasm (I haven't used nasm in years)
12:23:04 <kimundi> "error: unrecognised directive [align]" - nope, not either - I'll google it know that I know what to look for
12:23:18 --- join: alphawarr1or (uid243905@gateway/web/irccloud.com/x-wsrjdgkxduhxmisy) joined #osdev
12:23:22 <doug16k> just align, no []
12:23:33 <doug16k> ALIGN 16
12:23:42 <doug16k> http://www.nasm.us/xdoc/2.13.02/html/nasmdoc4.html#section-4.11.12
12:23:43 <bslsk05> ​www.nasm.us: NASM - The Netwide Assembler
12:24:20 <kimundi> "error: attempt to assemble code in [ABSOLUTE] space"
12:24:21 <kimundi> hmmm
12:25:49 <doug16k> ah crap, then you'll probably need to directly adjust $
12:27:11 <lava> any quick idea why i could be not getting pagefaults on a kernel page when running in kernel mode despite setting it to read-only and writing to it?
12:27:18 <lava> i would expect a write pagefault
12:27:32 <doug16k> lava, did you invlpg it?
12:27:34 <bcos> kimundi: Use "alignb" in the .bss and absolute sections
12:27:53 <lava> doug16k: should swap cr3 suffice?
12:28:06 <doug16k> lava, not if the PTE has global bit set
12:28:12 <lava> no global bit set
12:28:23 <doug16k> did you enable CR0.WP ?
12:28:35 <kimundi> bcos: alignb seems to be accepted,thanks!
12:28:38 <bcos> lava: There's a "WP" flag in CR0 that you'd need to set - without that the CPU ignores "read-only" for supervisor
12:28:43 <lava> ah!
12:28:47 <lava> that must be it
12:28:49 --- join: immibis (~chatzilla@122-59-200-50.jetstream.xtra.co.nz) joined #osdev
12:29:28 --- join: bm371613 (~bartek@89-64-31-161.dynamic.chello.pl) joined #osdev
12:31:56 <kimundi> doug16k: Hm, the C++ side does not seem to like a alignas(16) before the fpu member either - loking at cppref, it seems like its supposed to go on a struct itself?
12:32:48 <doug16k> works for me
12:32:58 <b0l_> pagefault in kernel mode should happen with PAE I guess
12:33:00 <kimundi> alignas(16) char fpu[512];
12:33:17 <kimundi> error: expected specifier-qualifier-list before ‘alignas’
12:33:17 <doug16k> yeah, that should work. what does the compiler say?
12:33:29 <kimundi> ah wiat, I think this one file compiles as C instead of C++
12:33:42 <kimundi> For reasons I could not comprehend
12:34:11 <doug16k> ok, then manually add padding
12:34:14 --- join: ca (~chris@nullcode.org) joined #osdev
12:34:28 <doug16k> figure out the offset of it and put a dummy char array before that member
12:34:44 <doug16k> or, reorganize it so it is the first member and registers are after
12:34:49 <lava> many thanks from my students
12:34:51 <kimundi> is that all alignas does? add padding? how does that ensure the final address of the member is at a 16 byte boundary?
12:34:56 <doug16k> first way is probably easier
12:35:04 <lava> they're implementing copy on write for some kernel pages
12:35:15 <lava> (page tables and such)
12:35:18 --- join: John_Ivan (~John_Ivan@unaffiliated/john-ivan/x-3287162) joined #osdev
12:35:25 <doug16k> kimundi, it will propagate to the enclosing type, so that whole structure takes on the largest alignment of its members
12:35:41 --- join: garit (~garit@94.197.121.65.threembb.co.uk) joined #osdev
12:35:41 --- quit: garit (Changing host)
12:35:41 --- join: garit (~garit@unaffiliated/garit) joined #osdev
12:35:57 <kimundi> doug16k: that seems to imply to me that it doesn't do that with manual padding though, only with an explicit alignas, right?
12:36:04 --- join: sortie (~sortie@static-5-186-55-44.ip.fibianet.dk) joined #osdev
12:36:11 <doug16k> it doesn't with manual padding, correct
12:36:20 <doug16k> that's why alignas is good :)
12:36:31 <kimundi> okay - then I'll just goolge what gcc extension I can use for C code here :P
12:36:51 <doug16k> if it is gcc, use __attribute__((aligned(16)))
12:37:02 <kimundi> after the member?
12:37:29 <doug16k> before the type should work
12:37:31 <kimundi> alright, seems to work
12:38:07 <kimundi> https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html - nope, after
12:38:08 <bslsk05> ​gcc.gnu.org: Using the GNU Compiler Collection (GCC)
12:38:17 <doug16k> dude, I just tried it
12:38:42 <doug16k> but sure, do what docs say
12:39:05 <sortie> kimundi: That is ancient gcc documentation. gcc 3.2 is ancient.
12:39:19 <kimundi> Sorry! Just tried it as well after the type and wanted to make sure there is no misunderstanding
12:39:24 <sortie> You want to read https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html :)
12:39:25 <bslsk05> ​gcc.gnu.org: Using the GNU Compiler Collection (GCC): Variable Attributes
12:39:51 <sortie> (Not that you did anything wrong -- I'm just helpfully directing people to the latest documentation whenever I see old links -- sometimes search engines gives you old versions that you shouldn't read)
12:40:00 <bcos> "university project" - probably stuck with the old version
12:40:34 <doug16k> putting it at the end of the line is disgusting imho, but whatever works
12:40:42 <kimundi> sortie: Yeah, its old gcc, but I would have been surprised if this particular syntax would have changed in a subtle way after I saw it :)
12:40:50 <sortie> bcos: Ah yes. I remember OS class that was stuck on a gcc 2.99. I managed to bootstrap a gcc 4.x on a Linux 2.2 system so it wasn't horrible.
12:41:13 <sortie> kimundi: Ah I missed the old gcc requirement :) Just pattern matching on limited context. :)
12:41:37 <kimundi> doug16k: I was not sure if putting it before might accidentally make it aplly to the member before it
12:41:49 <doug16k> through the semicolon?
12:41:56 <bcos> I think that sort of thing happens a lot - professor slaps together "resources" and then re-uses it for about 2 decades.. ;-)
12:42:42 <kimundi> doug16k: Just before you would not expect this, does not mean it couldn't happen! ;)
12:42:49 <kimundi> because*
12:43:23 <kimundi> anyway, thanks again you two - I've add everything to the code, and the OS seems to still run correctly
12:43:48 <doug16k> nice
12:44:14 <kimundi> bcos: Yeah - its interesting in this case because the prof upgraded to making this course about a _x64 OS for the first time this semester
12:44:16 <doug16k> note that that won't work for avx. I doubt the course requires avx support
12:44:19 --- quit: sortie (Quit: Leaving)
12:44:38 <doug16k> avx = 256 bit sse registers
12:45:10 <kimundi> doug16k: Depends on what the compiler spits out, I guess
12:45:15 <doug16k> to enable that you need 512 bit aligned context save area, and to use xsetbv to configure xsave/xrstor
12:45:22 <doug16k> it won't spit out avx unless you tell it to
12:45:24 <kimundi> good to know
12:45:40 <kimundi> even with optimizations enabled? (but not march=native) ?
12:45:48 <kimundi> just asking what to expect
12:46:17 <doug16k> only newer processors have avx. you should expect it to stick to 128-bit registers, which fxsave/fxrstor will support
12:46:23 <kimundi> alright
12:46:36 <doug16k> march=native will probably enable avx on a newer machine though, be careful with that
12:48:16 <doug16k> you can force avx off with -mno-avx
12:48:46 <doug16k> so -march=native -mno-avx will probably work with what you have
12:49:43 <kimundi> I'll add the -mno-avx to be sure then
12:49:54 <kimundi> Okay, so this is the full diff: https://github.com/Kimundi/oostubs-temp/commit/208665c44b66f33d6609cffc1fb483b1e1f59e8d
12:49:56 <bslsk05> ​github.com: enable sse, and do proper sse state saving · Kimundi/oostubs-temp@208665c · GitHub
12:50:02 <kimundi> Does this look correct?
12:50:30 <doug16k> looks right
12:50:43 <doug16k> did you set those CR4 bits?
12:52:04 --- quit: m3nt4L (Remote host closed the connection)
12:52:08 <kimundi> doug16k: err, not sure: https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-5/startup.asm#L426
12:52:09 <bslsk05> ​github.com: oostubs-temp/startup.asm at marvin-aufgabe-5 · Kimundi/oostubs-temp · GitHub
12:52:19 <kimundi> If that code is correct?
12:52:23 <doug16k> yeah -> https://github.com/Kimundi/oostubs-temp/blob/marvin-aufgabe-5/startup.asm#L432
12:52:25 <bslsk05> ​github.com: oostubs-temp/startup.asm at marvin-aufgabe-5 · Kimundi/oostubs-temp · GitHub
12:52:39 --- quit: immibis (Ping timeout: 248 seconds)
12:52:54 <kimundi> Ah, was I supposed to change that to eax or rax or so?
12:53:09 <doug16k> no it's fine
12:53:15 <kimundi> kay, thanks
12:53:30 <doug16k> I was wrong earlier, only 32 bit writes zero upper 32. thanks olsner
12:54:30 --- join: macdonag (~macdonag@cpc110673-lewi19-2-0-cust478.2-4.cable.virginm.net) joined #osdev
12:55:09 --- quit: uvgroovy (Quit: uvgroovy)
12:55:11 <doug16k> "32-bit operands generate a 32-bit result, zero-extended to a 64-bit result in the destination general-purpose register." "8-bit and 16-bit operands generate an 8-bit or 16-bit result. The upper 56 bits or 48 bits (respectively) of the destination general-purpose register are not modified by the operation."
12:56:22 <doug16k> it's not great for performance to make the CPU merge the partial register, but for that one time thing, a nanosecond is irrelevant
12:56:27 --- join: caladrius (~quassel@188.25.93.211) joined #osdev
12:56:30 <kimundi> yeah
13:00:09 --- quit: raphaelsc (Remote host closed the connection)
13:00:31 --- join: raphaelsc (~raphaelsc@191.35.21.144) joined #osdev
13:01:21 --- quit: kimundi (Read error: Connection reset by peer)
13:04:52 --- join: kimundi (~Kimundi@p57A89BB1.dip0.t-ipconnect.de) joined #osdev
13:05:27 --- join: nobodyy (~John_Ivan@79.97.140.214) joined #osdev
13:06:56 --- quit: kimundi (Read error: Connection reset by peer)
13:07:34 --- quit: John_Ivan (Ping timeout: 248 seconds)
13:07:51 --- join: kimundi (~Kimundi@p57A89BB1.dip0.t-ipconnect.de) joined #osdev
13:13:33 <b0l_> why cr0.WP is useful for process CoW? the WP bit doesn't affect only kernel bahaviour?
13:19:56 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
13:19:57 <lava> b0l_: well
13:20:18 <lava> imagine you map the page tables to kernel accessible virtual pages, but read only
13:20:23 --- join: Shamar (~giacomote@unaffiliated/giacomotesio) joined #osdev
13:20:26 <lava> then you can implement copy on write for the page tables
13:20:36 <lava> so you only have to copy pml4, but nothing below
13:20:41 <lava> anything below is copy on write
13:20:57 <lava> so... indirectly it is useful for process cow
13:21:16 <b0l_> what do you mean with "page tables to kernel accessible virtual pages"?
13:21:48 --- quit: uvgroovy (Client Quit)
13:21:56 <lava> you map the physical page table pages somewhere in the virtual address space in the process
13:21:59 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
13:22:01 <lava> but not user accessible of course
13:22:06 <lava> + read only
13:22:26 <lava> then you need cr0.WP to actually enable the read only flag here
13:22:36 <lava> read only / writeable
13:22:55 <b0l_> ah ok
13:23:00 <b0l_> makes sense
13:23:17 <lava> so when you fork
13:23:22 <lava> you only need exactly 1 page
13:23:25 <lava> for the pml4
13:23:33 <lava> but no other page for the entire virtual address space
13:24:09 <b0l_> yes, because they are read-only and shared with parent
13:25:46 --- join: muotori (~ubuntu@host31-49-114-221.range31-49.btcentralplus.com) joined #osdev
13:27:15 --- quit: bm371613 (Quit: Konversation terminated!)
13:33:38 <b0l_> lava: what I don't get is, if is the process to make the write, the CoW happens also if WP is 0, because the write is always deny from Userspace
13:35:15 --- quit: vaibhav (Quit: Leaving)
13:37:31 --- quit: dude12312414 (Quit: Segmentation fault: 11)
13:43:59 --- join: dude12312414 (None@gateway/shell/elitebnc/x-tdhuqyityaxpukge) joined #osdev
13:46:11 --- join: king_idiot (~ahaslett@124.157.115.222) joined #osdev
13:47:06 --- quit: dhoelzer (Ping timeout: 265 seconds)
13:47:29 --- quit: nobodyy (Quit: Систем политик аметзит, крэтин щй ваи д ел.)
13:47:51 --- join: John_Ivan (~John_Ivan@79.97.140.214) joined #osdev
13:47:51 --- quit: John_Ivan (Changing host)
13:47:51 --- join: John_Ivan (~John_Ivan@unaffiliated/john-ivan/x-3287162) joined #osdev
13:49:35 --- join: ampotos_ (~ampotos@lew31-1-78-247-114-197.fbx.proxad.net) joined #osdev
13:51:27 --- quit: ampotos (Ping timeout: 240 seconds)
13:51:43 --- quit: glfernando (Quit: Leaving)
13:56:46 --- quit: harukomoto (Ping timeout: 265 seconds)
13:59:49 --- quit: garit (Ping timeout: 240 seconds)
14:00:39 --- join: sortie (~sortie@static-5-186-55-44.ip.fibianet.dk) joined #osdev
14:01:47 --- join: glfernando (glfernando@nat/google/x-aalqctzwmlhbzdet) joined #osdev
14:02:07 <b0l_> in which case the kernel triggers the CoW for a process page?
14:03:01 --- join: tj_ (~tj@strlen.org) joined #osdev
14:04:40 --- nick: tj_ -> tj
14:06:04 <Belxjander> anyone here got any UEFI Linux kernel config recipes that are good baselines to start with
14:06:08 <Belxjander> ????
14:06:48 <Belxjander> I've been running into issues trying to configure a Linux kernel to actually bootstrap at all off a UEFI firmware (refind as bootloader with grub as alternate)
14:07:30 --- join: xerpi (~xerpi@254.red-88-23-232.staticip.rima-tde.net) joined #osdev
14:08:24 --- quit: xerpi (Remote host closed the connection)
14:08:50 --- join: xerpi (~xerpi@254.red-88-23-232.staticip.rima-tde.net) joined #osdev
14:09:09 <sortie> Belxjander: I don't know. Are you trying to make your own operating system or work with the Linux kernel? If you are trying to work with the Linux kernel, ##kernel might be a better place to ask your question.
14:11:21 <Belxjander> sortie: we;ll I am trying to get a working linux config on a ;ap@top before working with an own project to make a "Linux profile" for essential userland<->kernel bindings within a Virtual Environment setup of my own
14:11:58 <Belxjander> I've been hacking the config for about a month or so without any single booting kernel at all...
14:13:06 <Belxjander> and when using refind...and downloading and trying ArchLinux/Gentoo/... and other pre-made kernels...I only have success with those when I am "msdos-bios" mode launching them...not a single kernel has actually launched from UEFI-Shell or GPT-UEFI(refind) bootstrap at all...
14:13:25 <Belxjander> and I have checked the laptop to make sure "secure boot" is actually disabled
14:15:29 --- quit: Asu (Quit: Konversation terminated!)
14:19:25 --- quit: retpoline (Quit: bye)
14:21:32 --- quit: eivarv (Quit: Sleep)
14:23:21 --- quit: uvgroovy (Remote host closed the connection)
14:23:33 --- join: uvgroovy (~uvgroovy@199.188.233.130) joined #osdev
14:24:32 --- join: retpoline (~retpoline@199.254.238.222) joined #osdev
14:26:10 --- join: sprocklem (~sprocklem@unaffiliated/sprocklem) joined #osdev
14:28:33 <muotori> i'm following the xv6 MIT course on my spare time and in one of the files it has some inline assembly which for me fails to compile with bunch of "junk after expression" errors
14:29:01 <muotori> supposedly it's quite widely used system and I see no one else reporting same issue so I'm wondering if something could be wrong in my environment
14:29:36 <doug16k> muotori, old assemblers don't like U or L or LL suffixes on constants. that'd be my first guess
14:29:43 <doug16k> what version of binutils are you using?
14:31:22 --- quit: m_t (Quit: Leaving)
14:32:30 <muotori> doug16k: 2.28
14:32:38 <doug16k> it would help a lot to see an example inline assembly statement that has the error
14:32:44 --- quit: daniele_athome (Ping timeout: 256 seconds)
14:33:11 <muotori> https://github.com/LYP951018/xv6/blob/master/lab/user/faultregs.c the errors start at line 106
14:33:12 <bslsk05> ​github.com: xv6/faultregs.c at master · LYP951018/xv6 · GitHub
14:33:17 <doug16k> 2.28 is new enough
14:33:31 --- join: daniele_athome (~daniele_a@93-40-14-81.ip36.fastwebnet.it) joined #osdev
14:33:41 <muotori> user/faultregs.c:106: Error: junk `(%ebx)+0x24' after expression
14:33:50 --- quit: user10032 (Quit: Leaving)
14:33:54 <muotori> these are the type of errors I get
14:34:44 <doug16k> because that is not valid syntax
14:34:52 <doug16k> should be 0x24(%ebx)
14:36:00 <doug16k> but double up the % inside an asm with constraints, so 0x24(%%ebx) in the asm statement
14:36:31 <b0l_> ah ok, a CoW can be triggered from kernel only with a syscall
14:37:47 <b0l_> read(fd, buf_ro, size) so cr0.WP is usefull when buf_ro is still read-only after a fork() and kernel (via read()) tries to write it
14:38:27 --- quit: regreg (Ping timeout: 240 seconds)
14:39:42 <doug16k> muotori, there are better ways to inject constants into asm code than what that thing does with preprocessor tricks. you can use constraint inputs to pass in constants, give them names, and put them in the code with %n[some_name_here]
14:39:55 <muotori> doug16k: okay thanks, as that syntax is not in the inline assembly itself how would I go fixing those statements?
14:40:43 <doug16k> because it is doing it wrong. you have no way of knowing what "m" will end up being
14:41:46 <doug16k> it could end up being (%ebx) or worse, something that has an offset already. then you don't know whether to put + after the offset or not
14:42:44 <muotori> Okay, I see
14:43:03 <doug16k> I would change "m" (before), "m" (after) to [before] "r" (&before), [after] "r" (&after), then construct my operand like 0x24(%[before]) or after or whatever
14:45:04 <doug16k> with "m" you're saying "hey generate mystery instruction operand that accesses it somehow, kthx"... with "r" you're saying "give me the address in a register and I'll take over from there"
14:45:29 <doug16k> note that I also asked for the address using &
14:46:07 <muotori> doug16k: aha, cool. I'll try that out. Thanks for the suggestion!
14:46:26 <doug16k> this is one of the issues with gcc inline asm. it can be done wrong and still work. someday when the code generator does something different, boom, it's invalid
14:47:23 <doug16k> it worked because due to fluke, it happened to be something where +0x24 made sense. it doesn't make sense against (%ebx)
14:47:23 --- quit: tacco\unfoog ()
14:47:38 <muotori> I see, yeah that makes sense
14:51:20 <muotori> It's gonna take me a bit instill all this, thanks for pointing me to right direction doug16k!
14:55:05 --- quit: FireFly (Quit: Goodbye)
15:00:24 --- quit: fujisan (Quit: Connection closed for inactivity)
15:02:10 --- quit: Tazmain (Quit: Leaving)
15:02:40 --- join: salek_ (~salek@a91-155-9-229.elisa-laajakaista.fi) joined #osdev
15:05:27 --- quit: Salek (Ping timeout: 260 seconds)
15:08:12 --- quit: b0l_ (Ping timeout: 260 seconds)
15:14:55 --- join: Tobba_ (~Tobba@h-25-170.A159.priv.bahnhof.se) joined #osdev
15:14:57 --- quit: caladrius (Ping timeout: 240 seconds)
15:18:11 --- quit: Tobba (Ping timeout: 268 seconds)
15:19:14 --- join: vdamewood (~vdamewood@unaffiliated/vdamewood) joined #osdev
15:19:42 --- quit: muotori (Remote host closed the connection)
15:24:21 --- join: freakazoid0223 (~IceChat9@pool-108-52-4-148.phlapa.fios.verizon.net) joined #osdev
15:24:22 --- join: JusticeEX (~justiceex@pool-108-30-196-198.nycmny.fios.verizon.net) joined #osdev
15:25:17 --- quit: freakazoid0223_ (Ping timeout: 260 seconds)
15:38:33 --- quit: sortie (Quit: Leaving)
15:44:21 --- quit: sprocklem (Ping timeout: 248 seconds)
15:49:08 --- join: FireFly (znc@freenode/staff/firefly) joined #osdev
15:49:35 --- quit: uvgroovy (Quit: uvgroovy)
15:50:09 --- quit: xerpi (Quit: Leaving)
15:52:00 --- join: pounce (~pounce@c-24-11-27-195.hsd1.ut.comcast.net) joined #osdev
15:52:23 --- quit: kimundi (Ping timeout: 256 seconds)
15:57:42 --- quit: John_Ivan (Read error: Connection reset by peer)
15:59:54 --- quit: macdonag (Remote host closed the connection)
16:00:08 --- join: macdonag (~macdonag@cpc110673-lewi19-2-0-cust478.2-4.cable.virginm.net) joined #osdev
16:06:13 <doug16k> it's a good idea to have WP on in the kernel even if you don't need it for CoW. without it, you could overwrite read only .text/.rodata/etc with crap
16:13:05 <doug16k> finally found and ordered 4x16GB (64GB) of DDR4-2400 ECC RAM. $961 all together \o/
16:13:43 --- quit: Shamar (Ping timeout: 248 seconds)
16:14:03 --- join: Darmor (~Tom@198-91-187-5.cpe.distributel.net) joined #osdev
16:14:20 <Mutabah> Yeah, defensive WP is a very good idea
16:15:29 <pounce> One of the first things I did in my kernel :p
16:15:47 <pounce> makes accidently overflowing the stack a lot harder
16:16:44 <doug16k> I put a massive 4MB guard region around all my stacks :D
16:17:08 <doug16k> at both ends!
16:17:26 <pounce> I really ought to create a virtual memory manager
16:17:35 <pounce> right now my stack allocator is pitiful
16:17:57 <pounce> (no deallocation, static size, etc)
16:19:59 --- quit: macdonag (Quit: macdonag)
16:20:54 --- join: win0err (~win0err@95-24-119-86.broadband.corbina.ru) joined #osdev
16:22:24 --- quit: awang (Ping timeout: 255 seconds)
16:22:44 <doug16k> pounce, implementing a virtual memory manager is fun, do it!
16:22:55 <clever> doug16k: also of note, if you try to dynamically allocate something over 4mb on the stack, it can still skip over that guard, gcc has some special flags, to make it poke around within the region its allocating, so it cant skip the guard
16:23:13 <doug16k> I have stack check enabled
16:23:20 <clever> nice
16:23:45 <doug16k> -fstack-check to be exact
16:23:50 --- quit: xenos1984 (Quit: Leaving.)
16:24:21 <doug16k> it generates `or $0,-xxx(%rsp)` in functions that use a non-trivial amount of stack space
16:25:55 <doug16k> most of my functions are pretty gentle on the stack so it doesn't always get emitted
16:26:22 --- quit: alphawarr1or (Quit: Connection closed for inactivity)
16:26:32 <pounce> doug16k: that's the plan, but I want to do scheduling first
16:26:47 <doug16k> my kernel's heap malloc and free are blazing fast so I don't have to avoid them like the plague
16:27:13 <pounce> what algorithm do you use for it? is it threaded?
16:27:30 <pounce> (and by that I mean does it support threads)
16:27:35 <doug16k> yes
16:28:03 --- quit: win0err (Quit: Mutter: www.mutterirc.com)
16:28:08 <doug16k> https://github.com/doug65536/dgos/blob/master/kernel/lib/heap.cc
16:28:10 <bslsk05> ​github.com: dgos/heap.cc at master · doug65536/dgos · GitHub
16:28:17 <doug16k> power of two bucket pools
16:29:06 <doug16k> you can create private heaps too
16:29:25 <doug16k> malloc/realloc/free are wired up to use a default one
16:31:19 <doug16k> anything over 64KB falls back to paged allocator, which is also very fast
16:31:45 <doug16k> I put a lot of effort into making the memory manager as fast as possible
16:32:29 <pounce> Yep, that's something else I need to rewrite
16:32:41 <doug16k> the common case in the heap allocator takes tens of nanoseconds. 47ns or so? I forget exactly
16:33:25 <pounce> how long have you been working on dgos?
16:33:34 --- join: awang (~awang@cpe-98-31-27-190.columbus.res.rr.com) joined #osdev
16:34:33 <doug16k> 1st commit 27 Oct 2016
16:34:57 <doug16k> there was a couple of month gap in there somewhere when I was swamped with other work
16:37:00 --- quit: awang (Client Quit)
16:37:14 --- join: awang (~awang@cpe-98-31-27-190.columbus.res.rr.com) joined #osdev
16:38:24 --- quit: awang (Client Quit)
16:38:39 --- join: awang (~awang@cpe-98-31-27-190.columbus.res.rr.com) joined #osdev
16:40:25 --- quit: awang (Client Quit)
16:40:42 --- join: awang (~awang@cpe-98-31-27-190.columbus.res.rr.com) joined #osdev
16:52:58 --- join: hppavilion[1] (~dosgmowdo@160-7-174-206.gci.net) joined #osdev
17:05:46 --- join: zendainc (~zendainc@203.170.13.29) joined #osdev
17:15:38 --- join: sprocklem (~sprocklem@unaffiliated/sprocklem) joined #osdev
17:19:42 --- quit: svk (Quit: Leaving)
17:29:59 --- quit: quc (Remote host closed the connection)
17:30:15 --- join: quc (~quc@host-89-230-165-217.dynamic.mm.pl) joined #osdev
17:40:16 --- quit: raphaelsc (Remote host closed the connection)
17:50:32 --- join: wcstok (~Me@c-71-197-192-147.hsd1.wa.comcast.net) joined #osdev
17:57:06 --- join: chao-tic (~chao@203.97.21.86) joined #osdev
18:16:25 --- join: variable (~variable@freebsd/developer/variable) joined #osdev
18:21:59 --- quit: hppavilion[1] (Ping timeout: 256 seconds)
18:29:19 --- join: raphaelsc (~raphaelsc@191.35.21.144) joined #osdev
18:31:56 --- join: uvgroovy (~uvgroovy@c-65-96-163-219.hsd1.ma.comcast.net) joined #osdev
18:33:29 --- quit: uvgroovy (Client Quit)
18:33:48 --- join: uvgroovy (~uvgroovy@c-65-96-163-219.hsd1.ma.comcast.net) joined #osdev
18:35:57 --- quit: awang (Ping timeout: 240 seconds)
18:43:32 --- quit: Darmor (Ping timeout: 268 seconds)
18:45:59 --- join: Darmor (~Tom@198-91-187-5.cpe.distributel.net) joined #osdev
18:47:28 --- join: hppavilion[1] (~dosgmowdo@160-7-174-206.gci.net) joined #osdev
18:51:32 --- join: multi_io (~olaf@x4e37b281.dyn.telefonica.de) joined #osdev
18:54:15 --- quit: variable (Quit: /dev/null is full)
18:55:19 --- quit: multi_io_ (Ping timeout: 264 seconds)
19:08:35 --- quit: epony (Quit: QUIT)
19:19:54 --- quit: adminseodwn (Quit: Leaving)
19:23:27 --- join: hmmmmm (~sdfgsf@pool-72-79-165-90.sctnpa.east.verizon.net) joined #osdev
19:26:31 --- quit: hmmmm (Ping timeout: 264 seconds)
19:31:58 --- quit: uvgroovy (Quit: uvgroovy)
19:48:07 --- quit: MDude (Ping timeout: 264 seconds)
19:48:37 --- quit: chao-tic (Ping timeout: 248 seconds)
19:50:20 --- join: MDude (~MDude@c-73-187-225-46.hsd1.pa.comcast.net) joined #osdev
19:50:36 --- join: hmmmmmm (~sdfgsf@pool-72-79-165-160.sctnpa.east.verizon.net) joined #osdev
19:54:15 --- quit: hmmmmm (Ping timeout: 276 seconds)
19:55:15 --- quit: sprocklem (Ping timeout: 255 seconds)
20:00:54 --- join: Arcaelyx (~Arcaelyx@2601:646:c200:27a1:b885:c1a6:864:b96d) joined #osdev
20:00:54 --- quit: atk (Quit: Well this is unexpected.)
20:01:47 --- join: Wastedone_ (~Thunderbi@2600:8806:8801:5600:49b0:f170:9ddc:6cee) joined #osdev
20:02:24 --- quit: shirk (Quit: Oh Snap!)
20:02:51 --- join: dbittman (~dbittman@2601:647:ca00:1651:b26e:bfff:fe31:5ba2) joined #osdev
20:02:52 --- join: chao-tic (~chao@203.97.21.86) joined #osdev
20:06:49 --- join: warnock (~user@node-1w7jr9ulwmlosaigxt03lg5kh.ipv6.telus.net) joined #osdev
20:08:52 --- quit: warnock (Remote host closed the connection)
20:09:04 --- join: atk (Arch-TK@ircpuzzles/staff/Arch-TK) joined #osdev
20:10:23 --- join: shirk (~shirk@bitspin.org) joined #osdev
20:12:53 --- quit: chao-tic (Quit: WeeChat 1.0.1)
20:17:40 --- join: warnock (~user@node-1w7jr9ulwmlosaigxt03lg5kh.ipv6.telus.net) joined #osdev
20:22:36 <warnock> I'm attempting to create a program that runs on bare metal and it was working fine until I tryed to isolate things into functions. When I call a function it jumps to the address after the location of the call instead of the address of the called function. Does anybody have an idea why that might happen? https://gist.github.com/barryWarnock/0d63e414dbec77d64ec76c5977b7932a
20:22:37 <bslsk05> ​gist.github.com: broken real mode c program · GitHub
20:23:15 <warnock> see line 23 of decompiled_main.o
20:23:41 --- quit: Wastedone_ (Quit: Wastedone_)
20:24:16 --- join: Wastedone_ (~Thunderbi@2600:8806:8801:5600:49b0:f170:9ddc:6cee) joined #osdev
20:25:33 <vdamewood> warnock: How are you linking it?
20:26:09 <warnock> ld -o tetris.bin -m elf_i386 -Ttext 0x1000 launch_tetris.o tetris.o --oformat binary
20:26:09 <warnock>
20:26:51 <warnock> ld -o main.bin -m elf_i386 -Ttext 0x1000 launch.o main.o --oformat binary
20:26:51 <warnock>
20:28:08 --- quit: Wastedone_ (Client Quit)
20:28:23 <Mutabah> That looks like it hasn't been linked correctly... , wait is that the objdump of main.o or main.bin?
20:29:07 <warnock> main.o
20:29:25 <vdamewood> .o files won't have the correct locations in call instructions
20:29:27 <Mutabah> That's valid for main.o
20:30:10 <warnock> it's not calling a label though just a relative address which seems wrong
20:30:11 <Mutabah> (tip, link to a elf file, then use objcopy to convert it to a flat binary - makes it easier to debug)
20:30:22 <Mutabah> warnock: It's not showing the relocation information
20:30:44 <warnock> I'll try that, thanks
20:31:02 <vdamewood> warnock: When is .o file is made, there isn't enough information to locate a label's location at execution time.
20:31:44 <vdamewood> When is --> When a
20:32:18 <warnock> the reason I assumed that was the problem is that my code halts in qemu as soon as it hits a function call, I can do things before but not after
20:32:57 <vdamewood> How are you loading this thing, anyway?
20:34:12 <warnock> I copied boot.asm verbatim from this tutorial https://blog.ghaiklor.com/how-to-implement-a-second-stage-boot-loader-80e75ae4270c
20:34:14 <bslsk05> ​blog.ghaiklor.com: How to implement a second stage boot loader? – Eugene Obrezkov
20:34:46 --- join: sprocklem (~sprocklem@unaffiliated/sprocklem) joined #osdev
20:40:19 --- join: Humble (~hchiramm@2405:204:522d:4505:d868:56b5:2e33:b261) joined #osdev
20:43:11 <Mutabah> warnock: Check the disassembly of the thing you actually run. And look into invoking a debugger in qemu (it has gdb support, which can be quite useful)
20:47:05 * geist is on a plane
20:47:10 <geist> entertain me
20:48:40 * Mutabah releases snakes
20:48:49 <vdamewood> geist: A statistician refused for months to fly a plane when he found out how likely it was that there was a bomb on any given flight. Then he found out what the odds were that there would be two bombs on any given flight. So, now he brings a bomb whenever he flies.
20:49:59 --- quit: quc (Remote host closed the connection)
20:50:12 --- join: quc (~quc@host-89-230-165-217.dynamic.mm.pl) joined #osdev
20:50:52 --- quit: hppavilion[1] (Remote host closed the connection)
20:50:56 <geist> vdamewood: hah
20:51:28 --- join: hppavilion[1] (~dosgmowdo@160-7-174-206.gci.net) joined #osdev
20:51:37 <pounce> geist: where're you off to?
20:51:57 <vdamewood> An airport
20:52:37 <vdamewood> Most of my flights have ended up at airports.
20:53:15 <klange> mine tend to end in a body of water
20:53:29 <klange> my favorite part of flying is when you ride the yellow slide at the end
20:53:51 <vdamewood> They don't let you use that at the airport.
20:54:29 <asecretcat> yall haven't had a real flight until you've flown out of the atmosphere and into space
20:54:49 <vdamewood> I've only flown out of the atmosphere, not into space.
20:55:12 <vdamewood> I can't wait for a flight where I can do both.
20:55:40 <vdamewood> geist: So, did you pay the bajillion dollars for in-flight wifi?
20:56:44 <pounce> ^^DNS isn't blocked in flight, so one could possibly get internet access through DNS-packet metadata
20:56:53 <pounce> if they're crafty enough to set up their own DNS server
20:57:24 * vdamewood blinks
20:57:48 <klange> I have a thing for that.
20:58:01 <vdamewood> now I want to implement this.
20:58:09 <pounce> http://code.kryo.se/iodine/ vdamewood
20:58:10 <bslsk05> ​code.kryo.se: kryo.se: iodine (IP-over-DNS, IPv4 over DNS tunnel)
20:59:57 <klange> I have a custom thing that I tunnel ssh over
21:00:47 <vdamewood> pounce: Thanks.
21:01:25 <pounce> there's also http://savannah.nongnu.org/projects/nstx/ but it hasn't been updated in /15 years/
21:01:26 <bslsk05> ​savannah.nongnu.org: NSTX -- tunneling network-packets over DNS - Summary [Savannah]
21:03:08 <vdamewood> Now if only I had a Static IP address at home or a VPS.
21:03:27 --- quit: nshp (Quit: ZNC 1.6.5 - http://znc.in)
21:03:44 --- quit: quc (Ping timeout: 256 seconds)
21:08:16 --- quit: daniele_athome (Ping timeout: 256 seconds)
21:08:43 --- join: daniele_athome (~daniele_a@93-40-14-81.ip36.fastwebnet.it) joined #osdev
21:09:53 <geist> vdamewood, no i had a coupon
21:10:13 --- join: quc (~quc@87.116.237.205) joined #osdev
21:10:26 <vdamewood> coupon redeemable for one free packet
21:12:10 <geist> that's basically my experience right about now
21:12:17 <geist> connection to my shell box keeps dropping
21:18:57 --- quit: king_idiot (Ping timeout: 255 seconds)
21:32:39 --- quit: Humble (Quit: Leaving)
21:32:51 --- join: Humble (~hchiramm@2405:204:522d:4505:d868:56b5:2e33:b261) joined #osdev
21:33:11 --- join: regreg (~regreg@85.121.54.224) joined #osdev
21:33:31 --- quit: raphaelsc (Ping timeout: 256 seconds)
21:33:41 <jjuran> The choice of MD5 seems questionable.
21:34:09 --- join: immibis (~chatzilla@122-59-200-50.jetstream.xtra.co.nz) joined #osdev
21:41:34 --- join: Moose (~moose@unaffiliated/moose) joined #osdev
21:45:23 --- quit: pounce (Quit: WeeChat 2.0.1)
21:49:57 --- quit: sprocklem (Ping timeout: 276 seconds)
21:51:21 --- join: sprocklem (~sprocklem@unaffiliated/sprocklem) joined #osdev
21:53:12 --- quit: JusticeEX (Ping timeout: 260 seconds)
21:55:42 --- quit: freakazoid0223 (Quit: Life without danger is a waste of oxygen)
21:56:04 --- join: Lowl3v3l (~Lowl3v3l@141.35.23.133) joined #osdev
22:02:23 --- quit: klange (Quit: I am restarting my server for a VM RAM upgrade)
22:03:11 --- join: xenos1984 (~xenos1984@2001:bb8:2002:200:6651:6ff:fe53:a120) joined #osdev
22:09:20 --- quit: ahrs (Remote host closed the connection)
22:10:39 --- join: ahrs (quassel@gateway/vpn/privateinternetaccess/ahrs) joined #osdev
22:14:00 --- quit: dbittman (Ping timeout: 276 seconds)
22:19:03 --- join: klange (~klange@dakko.us) joined #osdev
22:26:36 --- join: KidBeta (~textual@202.53.53.27) joined #osdev
22:27:12 --- join: JusticeEX (~justiceex@pool-108-30-196-198.nycmny.fios.verizon.net) joined #osdev
22:27:54 --- quit: klange (Quit: leaving)
22:28:03 --- join: klange (~klange@dakko.us) joined #osdev
22:28:40 --- quit: klange (Client Quit)
22:28:47 --- join: klange (~klange@dakko.us) joined #osdev
22:31:01 --- join: oaken-source (~oaken-sou@141.89.226.146) joined #osdev
22:46:25 --- join: Tazmain (~Tazmain@41.189.78.208) joined #osdev
22:52:17 --- join: caladrius (~quassel@188.25.93.211) joined #osdev
22:59:58 --- quit: FreeFull ()
23:00:08 --- quit: KidBeta (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:12:00 --- quit: ryan-c (Quit: quitting)
23:19:12 --- quit: vdamewood (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:23:40 --- join: user10032 (~Thirteen@90.199.199.77) joined #osdev
23:30:37 --- join: eivarv (~eivarv@cm-84.215.4.97.getinternet.no) joined #osdev
23:34:47 --- quit: jjuran (Ping timeout: 256 seconds)
23:34:58 --- quit: abra0 (Quit: laters)
23:35:39 --- join: jjuran (~jjuran@c-73-132-80-121.hsd1.md.comcast.net) joined #osdev
23:42:15 --- quit: eivarv (Quit: Sleep)
23:50:38 --- join: PointlessMan (~fooman@dsl-kvlbng11-50dd57-46.dhcp.inet.fi) joined #osdev
23:53:03 --- join: garit (~garit@94.197.120.74.threembb.co.uk) joined #osdev
23:53:03 --- quit: garit (Changing host)
23:53:03 --- join: garit (~garit@unaffiliated/garit) joined #osdev
23:53:59 --- join: MarcinWieczorek (~marcin@212.182.27.201) joined #osdev
23:56:38 --- quit: user10032 (Remote host closed the connection)
23:59:59 --- log: ended osdev/18.01.16