IRC logs for #openrisc Saturday, 2017-02-25

--- Log opened Sat Feb 25 00:00:16 2017
--- Log closed Sat Feb 25 00:14:27 2017
--- Log opened Sat Feb 25 00:14:34 2017
-!- Irssi: #openrisc: Total of 50 nicks [0 ops, 0 halfops, 0 voices, 50 normal]00:14
-!- Irssi: Join to #openrisc was synced in 23 secs00:14
shornepsychotrope: I dont know of any random hardware on openrisc socs.  But linux provides this 'drivers/char/random.c'01:04
shorneyou can read about  linux /dev/random01:04
psychotropeokay thanks01:05
shorneI am sure you could easily make one though, you can read about fpga/hdml random number generators01:06
shornei.e. forcing metastable state01:07
shorneor, attach some kind of sensors01:07
psychotropeor I could just dump good randoms into /dev/random01:07
psychotropeyeah01:07
psychotropeI have an old lava lamp project I could dust off and use for randoms01:08
shornewell /dev/random works off of a bunch of ransom events from all over the kernel like keypresses etc01:08
shorneso just hidding the keyboard would help add entropy01:09
psychotropeand btw: thanks to everyone on #openrisc.  people here have been really nice in helping noobs (like me) get started with openRISC01:09
psychotropeyeah, but looking at lavalamps is more sexy01:09
shorneit matters who is touching my keyboard ;)01:09
psychotropeindeed01:10
shorneolofk: stekern_: btw all our patched got merged upstream01:21
shorne(for linux)01:22
shorneI didn't honor most of Jonas's request let me know if you think any were things you were concerned with01:23
psychotropein https://github.com/openrisc/tutorials/blob/master/README.md#tutorials, what is the differnece between "building it here" and "downloading the prebuilt library"01:30
psychotropeI think 2 or 3 steps off a "make *****-download" and a "make *****-build"01:31
psychotropecurious what the difference was01:31
huanyuI am playing with the virtio net via virtio MMIO with upstream QEMU with linux kernel with some minor change in the kernel and QEMU. I am able to get the virtio-net up and running. I am able to access the internet (wget file from ubuntu.com) but the problem is that starts to fail after few downloads and it behaves like a io stall. I did some search on the IRC, blueCmd has similar issue with QEMU virtio back in 2014-07-25. I am wonder01:45
huanyuing if anyone have a solution or found the cause of the problem.01:45
psychotropeI have or1ksim running, how do I compile programs and run them from linux in this case?02:08
shornepsychotrope: do you have a kernel built?02:25
psychotropeshorne: I think so02:26
psychotropeI followed the tutorial above and ran or1k-sim -f or1ksim.cfg ../vmlinux02:26
shornehuanyu: are you running openrisc? I was having an issue with just doing ping localhost, it hung after about the 3rd ping.  It didnt happen on any other emulators02:26
psychotropefrom the directory where I put all the tools ofc02:27
shornehuanyu: but when I hit any key it returns, maybe stdout flush issue02:27
shornepsychotrope: what happens when you run?02:27
psychotropeit runs, and I get linux booting in an xterm window02:27
psychotropewhat I want to know, is how to get programs into that VM and compile / run them02:28
psychotropemy quick pass of the documentation isn't shedding much light on the subject02:28
shorneok, what do you have set for CONFIG_INITRAMFS_SOURCE?02:28
psychotropeI want to run under linux, not bare metal ofc02:28
shorneprobably something like CONFIG_INITRAMFS_SOURCE="../openrisc/openrisc_os/initramfs ../openrisc/openrisc_os/initramfs.devnodes" ???02:29
psychotropeum, how would I check *noob questions*02:29
shorneLinux stores its config in '<linux>/.config' file02:29
shornealso in 'make menuconfig' you can type '/' and then search02:30
psychotropeso I should check from the VM I have booted I assume?02:30
shornecheck in your kernel source folder02:30
psychotropeall I have is vmlinux from the tutorial instructions02:31
shorneok, well in order to put your own software in the image you will need to build the kernel02:31
shorne(unless you have harddrive emulation and your vmlinux image supports it). I never did try that before02:32
psychotropeI have already downloaded:  https://github.com/openrisc/linux02:32
psychotropeinto the folder "linux"02:32
shorneok, do you have a toolchain?02:32
psychotropeI think so02:32
shornedo you have any binary called or1k-*-gcc?02:33
psychotropelet me check02:33
psychotropewhere would I find it most likely?02:34
shornewell, have you just been following the tutorial?02:35
psychotropemy "toolchains" driectory from the tutorial I mentioned above only has the folder ork1k-elf within it02:35
psychotropeyep02:35
psychotropethis is what I was using: https://github.com/openrisc/tutorials/blob/master/README.md#tutorials02:35
shornewell, you asked the questions about those commands02:35
shornehttps://github.com/openrisc/tutorials/blob/master/Makefile02:35
shorneDo you know how to read makefiles?02:36
shorneYou can see the difference in the makefile02:36
shorneif not... maybe we should explain a bit more clearly in the tutorial02:36
shorneor1ksim-build - that will download the source from git and build02:36
psychotropeno, I got a bit lost there02:36
psychotropethis is all alot of new territory for me02:37
psychotropeI defaulted to "make *-download in every case"02:37
shorneor1ksim-download - that will just download the binary (i.e. executables)02:37
shorneok02:37
psychotropeso should I should run make *-build instead ?02:38
shornewell tutorials/or1k-elf/bin should have your gcc02:38
shornedo you know what gcc is?02:38
psychotropeyes02:38
psychotropethere we go02:38
psychotropejust one directory away02:38
shorneno... binaries should be good enough as long as you dont have a problem02:38
shorneHow good are you with the command line in unix/bash?02:39
psychotropeso make *-download downloads binaries while *-build downloads and builds from source02:39
shorneyes02:39
psychotropeif I'm not misreadin the makefile02:39
psychotropesilly me02:39
psychotropeI'd say I'm pretty good with bash02:40
psychotropeI'm probably overthinking this02:40
psychotropeokay now that I have or1k-elf-gcc I can compile the software I want02:40
shornewell, if you want to find a toolchain binary that you downloaded it should be 'or1k- <tab>'02:40
psychotropenow the question would be, how do I bundle that with the kernel I want to boot02:41
psychotropeI want to compile a 3rd-party binary and run it from the or1ksim linux VM02:41
shorneWe can get to that, but first you should know where your toolchain is and it needs to be in your path02:42
psychotropefrom the project folder I have made, in /tutorials/toolchains/ork1k-elf/bin I'm seeing or1k-elf-gcc and a bunch of other stuff02:43
shorneAlso, for linux programs you would need MUSL to build them (read about them in recent release notes here http://openrisc.io/2017/02/18/gccreleaseandbins)02:43
shorneok is that in your PATH env variable too?02:43
psychotropelet me check02:44
psychotropeit would seem that user/tutorials/tools/or1ksim/bin is in my path enviroment variable02:45
psychotropeso I should be good ther02:46
shorneright, its puth there by environment.sh (you must have run that) you will have to run again if you login again02:47
huanyushorne: I am running openrisc qemu (qemu-system-or1k), upstream commit id: ad584d37f2a86b392c25f3f00cc1f1532676c2d1.02:47
psychotropeshorne: yeah I noticed that02:47
psychotropeshorne: had to log out of my SSH session so I ran . enviroment.sh from my project directory once I logged back in02:48
huanyushorne: ping was never a issue for me. Only when I try to downloading a file from the net02:48
shornehuanyu: sorry , never had the issue yet.  which kernel do you run?02:50
shornehuanyu: I didnt think the mainline had a driver for the qemu net device02:51
shornehuanyu: or are you running user mode?02:51
shornepsychotrope: ok, so then go into the linux directory02:51
shornepsychotrope: run 'make defconfig'02:51
psychotropeshorne: okay02:51
psychotropethanks02:51
psychotropeokay it finished02:52
psychotrope"config written to .config"02:52
shorneok then 'make menuconfig'02:52
huanyushorne: i am using the openrisc/linux02:52
huanyushorne: I am using the virtio-net with virtio-mmio02:53
psychotropewoah, an interactive menu02:53
huanyushorne: I am nto running the user mode02:53
psychotropefancy02:53
psychotropewhere should I start?02:53
shornehuanyu: ok, understood, sorry as I said I didnt ever use the network in qemu, maybe wait for another answer? or ping others. Sorry I dont have time to look at now02:54
huanyushorne: Thanks for you help.02:54
shorneIll probably look into networking drivers on openrisc in a weeks02:54
shorneI am planning to push the opencores ethernet driver upstream02:55
huanyushorne: :_)02:55
huanyushorne: :-)02:55
shornehuanyu: but was working on SMP first, maybe networking driver is more important?02:55
shornebut you are using the virtio maybe that a different driver, what is your qemu command line?02:56
shorneand are you running a custom devicetree?02:56
huanyushorne: tbh, i am not sure either. netowrking is usefull for play around02:57
shornepsychotrope: now from there you can setup some things02:57
shornebut first you need '<esc>' and save02:57
psychotropeso from the menu hit esc then tab over to save?02:58
huanyushorne: my qemu command- qemu-system-or1k -cpu or1200 -M or1k-sim -m 128 -netdev user,id=network1 -device virtio-net-device,netdev=network1 -serial mon:stdio  -kernel vmlinux-initramfs-qemuopenrisc.bin -tftp img02:58
shornepsychotrope: I forgot one thing, you need to do 'make ARCH=openrisc defconfig'02:58
shorneyes, form menu just save or exit we need to redo02:58
huanyushorne: I am using a custom devicetree02:58
huanyushorne: which adds a virtio-mmio node02:59
psychotropeshorne: okay I exited the menu with esc esc, I'll run make ARCH=openrisc defconfig before I do anything else02:59
shornehuanyu: oh, cool so you dont need a special driver02:59
psychotropeshorne: done02:59
shornehuanyu: have your tried with mainline kernel?02:59
huanyushorne: there is a driver in the kernel already. but I think the QEMU virtio-mmio device modeling has some endianness issue03:00
huanyushorne: I have not test the mainline kernel yet03:00
shornepsychotrope: then you can try 'make ARCH=openrisc menuconfig'03:01
psychotropeokay I ran that, and am getting a differnet menu page03:01
shornethen in the menu "General Setup", change the first compiler option to 'or1k-elf-'03:02
psychotropewhat exactly have I done so  far BTW in the linux folder?03:02
shornepsychotrope: this is the openrisc options, before you were on the x86 kernel config options03:02
psychotropeI see03:02
shornefor openrisc you need to cross compile03:02
shornehuanyu: do you think the endianess issue might be with qemu itself?03:03
psychotropeshorne: I'm not seeing any compiler options off bat03:03
huanyushorne: I believe so. I think it should be fixed in QEMU03:04
psychotropebut there is alot to look athrough in the general setup menu03:04
shornehuanyu: you mentioned minor change to get networking to work, that a qemu patch?03:04
shornepsychotrope: what do you see on the first line ?03:04
psychotropeoh03:04
psychotropeyeah....03:04
shornehuanyu: and you are a qemu developer?03:04
psychotropesorry D:03:04
huanyushorne: that was kernel driver hacking for endianness swap. I am currently looking the QEMU and trying make it aware of the endianness03:05
psychotropeokay I set the cross compiler tool prefix to or1k-elf-, so it should be using the righ toolchain now03:05
psychotrope*right03:06
huanyushorne: unfortunately i am not a qemu developer03:06
shornepsychotrope: so thats for telling the kernel to user commands like or1k-elf-gcc when compiling or other thing03:06
psychotropeshorne: I figured as much03:06
psychotropeI'm too dumb to realize that the first thing on tht list was interactive lol03:07
shornehuanyu: well, ok I cant help now, maybe if you send a patch to the list and ask questions others will know03:07
psychotropeI thought that was just a header or something03:07
psychotropesilly me03:07
shorneok next...03:07
huanyushorne: sounds good, thanks for the help03:07
shornepsychotrope: what does 'Initramfs source file()' say?03:07
shorneits down a bit more?03:07
psychotropelet me check03:08
psychotropestring value under Initramfs source file(s) is /openrisc/support/initramfs arch/openrisc/support/initramfs.devnodes03:08
shornepsychotrope: ok, thats what you want03:09
psychotropegood03:09
shornenow exit and save03:09
psychotropeI assume save then exit03:10
psychotropesaving to .config, correct?03:10
shornehaha, yet03:10
shorneyes03:10
psychotropeokay I saved it to .config03:10
psychotropethen exited03:10
shornenow just type 'make ARCH=openrisc'03:11
psychotropeI'm back on the command line in the linux folder03:11
psychotropeerrors...03:11
psychotropebin/sh: 1: bc: not found03:11
psychotropeKbuild:66: recipe for target 'include/generated/timeconst.h' failed03:11
psychotropemake[1]: *** [include/generated/timeconst.h] Error 12703:11
psychotropeMakefile:986: recipe for target 'prepare0' failed03:11
psychotropemake: *** [prepare0] Error 203:11
shorneyou have to install bc on your machine03:12
psychotropeokay03:12
psychotropewhat does bd do?03:12
psychotrope*bc03:12
shornebinary calc I think03:12
psychotropeokay I've got it installing03:12
shorneits just something used in the build scripts03:12
psychotropethanks a billion for the help here, I've never compiled linux before from source and this would have taken me days to figure out03:13
psychotropeokay its working along03:13
shornepsychotrope: it probably will not, but you need to know a bit about make03:13
shorneand then read the docs03:14
shornegoogle ' compile kernel '03:14
shorneprobably you dont even need to say linux03:14
shorneand you will get a bunch of docs03:14
shornehow many cores on your machine?03:15
psychotropeits flipping out over unsigned ints but its continuing to compile03:15
psychotropeI assume I shouldn't be concerned03:15
psychotropeshorne: 403:15
shorneyeah, the unsigned ints is a problem with newlib I think03:15
psychotropeits old core 2 quad machine I made from scraps03:15
psychotropeold PCs people were trying to get rid of lol03:16
shornealright, well you can do ctrl-c03:16
shorneand 'make -j5 ARCH=openrisc'03:16
psychotropewhat does j5 fix?03:16
shorne-j5 schedules 5 separate build jobs03:16
shornewell, something like that03:16
shornedo you get to use all your cores when compiling03:16
psychotropeokay I aborted and I'm now running with -j503:17
psychotropemuch faster03:17
shorneand we dont have to wait03:17
psychotropedone03:17
psychotropethat was fast03:17
shorneok... now you have your vmlinux in the directory03:17
psychotropeI have a vmlinux now in that folder03:17
psychotropesweet :)03:17
shorneright... so build works03:17
shornenow how to get binaries?03:17
psychotropewhat about them03:18
psychotropeI may have mentioned I wanted to use GPG on openrisc before, I have the binaries downloaded, but I'll need to read up on compiling GPG first03:18
shornejust build your other programs and the up them under 'openrisc/support/initramfs' directory03:18
psychotrope?03:18
shornelook in directory 'openrisc/support/initramfs'03:19
psychotropewhere would that be?03:19
shornein your current (linux) directory03:19
shornethat has your root filesystem for you linux image03:19
psychotropei have no openrisc directory...03:20
shorneoh.. I mean arch/openrisc/...03:20
psychotropein the linux folder03:20
psychotropeokay03:20
psychotropeso put my binaries in there and run make -j5 ARCH=openrisc again?03:21
shorneso you can see things like... bin, etc, usr, var ?03:21
psychotropeyeah03:21
shornewhen you build your binaries you can puth them there, and build linux again03:21
shorneand your can them boot the vmlinux to run a emulator with your binaries03:22
shorne(typos)03:22
shornesoo. next you need to build gpg03:23
psychotropeokay, and in that case, how would I take something massive like GPG, boil it down to one source with all the libraries included so I could put it in that folder as one source file?03:23
psychotropeyeah...03:23
psychotropehere is where going the scripting route rather than C is going to bite me in the ass03:23
psychotropeI'm new to that as well03:23
shornewell, you need another toochain read this: http://openrisc.io/2017/02/18/gccreleaseandbins03:24
shorneYou really need to have a good understanding of c, libc, linker, make , configure (autotools) to understand what you are doing when you want to cross compile something like gpg into a static binary03:25
shornepsychotrope: do you have any digital design background?03:26
psychotropeno D:03:26
psychotropewell as in?03:26
psychotropeprobably no if I don't know03:26
psychotropeI mess around with linux only as a hobby03:26
shorneas in, flipflops, state machines03:26
psychotropea bit, but not much03:26
psychotropeI think the fartherest I ever got was making a full adder03:27
shorneok, well thats good03:27
psychotropeI don't remember if I ever got it to work03:27
psychotropeso take note of that part03:27
shorneI am just thinking of the full stack, and what you need to know to do this (embedded soc + software) on your own03:28
shorneon hardware side03:28
psychotropewell, I'm happy to try to learn03:29
shorne[digital design: flip flops, state machine, adder etc ][hardare description language: VHDL, Verilog]03:29
psychotropeI figure I now have some idea of how to compile linux for openrisc, and I can probably figure out how to get it onto my DE0 nano once I can save up and buy one03:30
psychotropesince there are so many openrisc tutorials for the DE0 nano03:30
shornebut then on top of that [system on chip: Busses, memory mapped io, interconnects, spi]03:30
shorneIf you want to modify any of the hardware you would need to know a bit about those03:31
psychotropeshorne: I have worked with the SPI protocol when I played around with an 8-bit SPI LCD, and I have some *super* basic verilog knowledge03:31
shornepsychotrope: thats good03:31
psychotropeshorne: for now though, with the DE0-nano, how far can I get with FuseSOC03:31
psychotropethe only thing I see missing in most of the DE0-nano setups I see are some form of storage controller03:32
shornewith fusesoc you can get up and running and load your fpga with the openrisc CPU03:32
psychotropefor the project I want to do I need someway to read / write keys and messages to work with in GPG03:32
psychotropebut I'm super new to this stuff03:33
shornebut then you need to run another program [openOCD] to connect to the DE0-nano via the jtag/debug interface and upload your kernel/software03:33
shorneanyway,  you can do this03:33
psychotropethats one thing I always wondered about, how can I run the DE0-nano without another PC to load from JTAG03:33
psychotropethanks :D03:33
psychotropeI want this to be an independent system if I can03:34
shornepsychotrope: well as said before by someone else, de0 nano start up is loads a bitstream from flash03:35
shorneyou will need to push the openriscsoc in there03:35
psychotropeso it should be easy to put it in that same flash03:35
psychotropelinux alongside the bitstream03:35
psychotropeI see03:35
psychotropeI just wondered if that would be a considerable challenge or not03:36
shorneyeah, I think, I havent tried, I found a doc online about how to do it03:36
shorneI think you can search, the kernel is about 3mb03:37
psychotropeagain I'm very new to this (I'm a high school student and do all my experimenting in my free time, so no formal training)03:37
psychotropebut I'm happy to learn03:37
psychotropeyeah the kernel I just compiled was 12mb03:38
shornewas it 12? ok maybe no compression03:39
shornebut I am not sure how bit gpg will be03:39
psychotropelet me check03:40
psychotropeits not small...03:40
shorneok, now go into the gpg source directory03:40
shornewell, what are you checking?03:40
psychotropeyeah let me check03:40
psychotropethis is just the source I downloaded, I don't think it includes all the libraries I need03:40
psychotropeI think its around a few mb03:41
psychotrope4.3mb compressed03:42
psychotrope.tar.bz203:42
psychotropeuncompressed I'd have to do some math; of course ls -lh lists everything inside the directory03:42
psychotropesorry I misread your message, I was checking how big the gnupg folder I downloaded was03:43
psychotropeget a ballpark maximum for what I could be trying to put into ROM03:43
psychotropeit can't be any bigger than that compiled I assume03:44
shorneprobably not, yes you just have source03:44
shornewhen compiled it will not be nearly as large03:45
psychotropeyeah I would hope not03:45
shornebut you also may need several libraries03:45
psychotropeconsidering all the comments and notes / scripts in the source folder03:45
psychotropeyeah03:45
shorneso extract the tarball03:45
psychotroperight now I'm trying to track down something with the vmlinux kernel I compiled earlier03:45
psychotropegive me a second03:46
psychotropeI moved vmlinux out of the linux folder into my project folder with mv vmlinux ..03:46
psychotropebefore from the or1ksim folder within my project folder I was using or1k-sim -f or1ksim.cfg ../vmlinux  to run the simulation03:47
psychotropeby moving vmlinux out of the linux folder into the project folder, did I just overwrite the vmlinux I was using before?03:47
psychotrope*noob questions*03:48
shorneprobably03:50
psychotropeoh well03:50
shornebut it would have been the same as the one you built03:50
psychotropeyeah03:50
shorneyou can always download it again too03:50
psychotropeit was made 00:20 this morning so that must be it03:51
psychotropeit boots using or1ksim, so it works for me03:51
psychotropeanyway, back to gpg...03:51
psychotropeI extracted everything already03:51
shornego into the folder what do you see?03:51
psychotropea bunch of stuff03:51
psychotrope2 makefiles03:52
psychotropewell, just a ton of stuff03:52
psychotropeABOUT-NLS     agent    autogen.sh      common       configure.ac  doc  include  kbx        Makefile.am  po          scd      tests   tools03:52
psychotropeacinclude.m4  am       ChangeLog       config.h.in  COPYING       g10  INSTALL  keyserver  Makefile.in  README      scripts  THANKS  VERSION03:52
psychotropeaclocal.m4    AUTHORS  ChangeLog-2011  configure    COPYING.LIB   gl   jnlib    m4         NEWS         README.GIT  sm       TODO03:52
psychotropethats the output from ls03:52
shorneso the file 'configure.ac' means its and autoconf managed project03:55
shorne(very fundamental build tool for unix c projects)03:55
psychotropewhat does that mean in this case?03:55
psychotropeI'm happy to go look it up and come back03:55
shorneyou dont need to care about it as a use03:55
shorneas a user it doesnt matter03:56
shorneit generated 'configure'03:56
shorneThe maintainer will generate that before they create the tarball for us'03:56
shorneAlso you see the Makefile.am... thats the automake makefile03:57
shorne(automake is another essential tool)03:57
psychotropeI see ./configure and make in alot in projects, whats the simplest breakdown of what those do?03:57
psychotropeso makefile.am is automake, what about makefile.in?03:58
shornethese together allow c programs to be portable (compile on any cpu architecture, compile for any os)03:58
shornemakefile.am generates makefile.in03:58
shornemakefile.in is generated same time as configure03:58
shornemakefile.in is a "template" to make your make file03:59
psychotropewhy is this all pre generated in a source folder?03:59
shorneso you can configure your build03:59
shorne... you can probably look this up on youtube or something03:59
shorneanyway...03:59
psychotropeif makefile.in is generated by makefile.am, why include makefile.in at all?04:00
psychotropeokay, I can look this up later04:00
shornewhen you run ./configure (dont run) its just a shell script, it will figure out what you have on your system (do you have gcc? or something else?) (are you on linux)04:00
shorneThen it will do a find and replace on makefile.in to output your mail file04:01
shorneit will do that on all the *.in (input files) to generate your build04:01
shorne... output your makefile (for running make)04:01
psychotropeI see04:02
shorneanyway... you want to run './configure --target=or1k-linux-musl-'04:02
psychotropeokay, I'll give that a shot04:03
psychotrope*prepared for errors*04:03
shorneby default ./configure by itself thinks you want to make your binary (executable) for x86, so you need target to tell you want openrisc04:03
shorneI expect errors04:03
psychotropemissing libraries04:03
psychotropeto be expected04:03
shornebecause you do not have the 'linux' toolchain04:03
shorneor libs04:04
psychotropeI believe it needs libgcrypt according to the docs04:04
shornewhat does the error say?04:04
psychotropeconfigure: error:04:04
psychotrope***04:04
psychotrope*** Required libraries not found. Please consult the above messages04:04
psychotrope*** and install them before running configure again.04:04
psychotrope***04:04
psychotropein short04:04
shorneconsule above messages04:04
shornewhat above?04:04
psychotropeit mentions libgcrypt, libassuan, libgpg-error, libksba missing04:05
psychotropeand gives FTP links to get them from04:05
psychotropelooks like I better get to work with wget04:06
psychotropethe question is, for the C noob like me, where do I put all these libraries once I download them so the compiler can find them04:06
psychotropealso wants me to apt-get install libpth-dev04:07
psychotropefor GNU portable threads library04:07
shornewell, you cant do apt-get for those because that will download x86 binaries04:09
psychotropeyeah..04:09
psychotropeI get an FTP link to04:09
shorneyou want source04:09
psychotropeso I'll use that04:09
psychotropethe question is, where do I put all that04:10
shorneyeah, so get all those tar.bz2 / tar.xz 's downloaded04:10
psychotropeokay04:10
psychotropeshould I do that in another folder>04:10
psychotrope*?04:10
shornewell another thing you will want to do with ./configure is setup a path04:10
shornei.e.04:10
shorneI mean prefix04:11
shorneso something like ./configure --target=or1k=linux-musl- --prefix=$HOME/openrisc/linux-root04:12
shornethen you would run make && make install04:12
shorneand install will put them into there04:12
psychotropeso where should I put all these libraries exactly?04:13
shorneThen when you build a library that depends on something you already installed, you need to tell it where to look04:13
psychotropemaybe I'm missing the point entirely here...04:13
psychotropeI made another folder for now outside of the GPG folder where I'm putting all these things I'm downloading04:14
psychotrope*sigh* the ftp links are broken04:15
psychotropewell, the GPG ones are04:15
shorneyou can search google the should be there04:15
psychotropeyep04:15
psychotropethats what I'm doing04:15
psychotropegive me a bit to track these down04:16
shornewell where to put it is up to you04:16
psychotropethanks again for helping me out so much04:16
shornesomething like ~/work/tarballs04:16
shornethen extract them to ~/work/pgp-openrisc04:16
shorneor do it all under ~/work/openrisc04:16
psychotropeI have massive folder that includes stuff for the project along with openRISC04:17
psychotropethen I have a folder folder called "tutorials" with all my openRISC stuff04:18
psychotropeand a folder GPG with the extracted GPG source04:18
shorneBut after you start to compile the binies you will need to link them together.  You need to understand things like CFLAGS and LDFLAGS (which are used during build) to tell the compile and linker where to find your libraries.04:18
psychotropeI made another folder in that massive general project folder for the libraries I'm downloading04:18
shornemaybe there are better wayts to do it04:18
psychotropeI'm just working through the list of downloads right now04:19
shornemaybe get one to compile.. then go to bed :)04:22
shornealso read this page.. http://openrisc.io/2017/02/18/gccreleaseandbins04:23
psychotropeits friday, why go to sleep :P04:23
psychotropeokay, I'll take a look04:23
shorneah... you are still in high school04:23
psychotropeyeah...04:23
shornenice, I cant do that anymore04:23
shornewife and kids need me to make breakfast!04:23
psychotropelast one....04:26
psychotropeokay I have all the tarballs04:26
psychotropeI'll extract to another folder04:27
psychotropenow if only school was this much fun... lol04:28
shorneok, extract them along side your gpg one04:32
shornei.e. tar -xf <file>.tar.x -C ../openrisc04:32
psychotropeso go ahead and put the library folders in with the GPG folder?04:32
psychotropethey all have different tar extensions so I still have one left to untar04:33
psychotropetoo bad I don't have dtrx on this box04:33
psychotropeokay04:34
shorneok... well not in the GPG folder04:35
shornebut just next to it04:35
psychotropeI have everything extracted into a folder, but it isn't the GPG folder04:35
shornei.e. openrisc/gpg-xx04:35
psychotropeokay what I've done fits the bill04:35
shorneopenrisc/libcrypt04:35
shorneok04:35
shornealso... what about the openrisc.io page I linked you to?04:35
shornedid you see anything there?04:35
psychotropedidn't get a chance to take a look yet04:36
psychotropegive me a second...04:36
psychotropeokay so musl is the toolchain I want to be working with here04:37
psychotropeit seems04:37
shorneyes04:37
shorneso you will need to download that04:37
shorneluckily I created binaries04:37
shornethere is a link there04:37
psychotropedon't I already have that from the tutorial instructions?04:38
psychotropeI assume not04:38
psychotropegcc-or1k-musl-5.4.0-20170218.patch?04:38
shorneI think they just gave you newlib04:38
shorneget the .tar.xz file04:38
psychotropeokay04:38
psychotropewhere should I put that?04:39
psychotropeI'll put it in the project folder04:39
psychotropeokay I've extracted or1k-linux-musl04:41
psychotropewhy can't I just use the gcc from the toolchain I used to build the kernel?04:42
shorneBecause of linux04:44
psychotropeokay, I'll take your word for it04:44
psychotropeofc04:44
shorneThe one you used for the kernel is for running straight on the CPU04:44
shorneYou want to run gpg on top of linux04:45
psychotropeso its like running baremetal rather than under linux04:45
psychotropeI see04:45
shornelinux runs on the cpu04:45
shornedirectly04:45
psychotropeyeah ofc04:45
psychotropeso that other compiler used newlib, this used musl?04:45
shorneanway, you should learn a bit about system calls and what linux does04:45
psychotrope*uses04:46
shorneyeah, so in c there is this thing called libc04:46
shorneit allows programs to call functions like open(), close(), read() etc04:46
psychotropeI think its just me being tired and jumping to stupid conclusions04:46
shorneIf you run a c program on newlib and run read() it may go directly to the hardware04:47
psychotropeso I assume newlib does memory stuff that is otherwise handled by the kernel04:48
shorneIf you are on musl, and run read(), musl knows how to talk to Linux so  linux will do the hardware read (via the right driver etc)04:48
psychotropeI see04:48
shorneyeah, same with things like malloc ()  "give me some memory"04:48
shorneso you need musl04:48
psychotropeokay, I have it downlaoded an extracted04:49
shornebut you have it installed04:49
shorneyou need to add to your PATH04:49
psychotropehow do I add musl to my path?04:49
shornenot sure where you put it but 'export PATH=$PATH:<location of musl>/bin'04:49
shornethat way when you run 'or1k-linux-musl-gcc' it will find it04:50
shornedo you know what PATH is?04:50
psychotroperoughly04:50
psychotropeI come from a scripting background in most of my other projects, so the low-level C workflow is new to me04:51
shornehttp://www.linfo.org/path_env_var.html04:51
shorneWell, PATH is basic scripting04:51
shornemost basic scripting possible04:51
shorne:)04:51
shorneeven on windows04:51
psychotropewell, I never needed it with bash or python04:51
psychotropethen again04:51
shornehmm, I would need it with bash or pythong04:52
psychotropeI haven't done much besides script programs that I've already installled04:52
shornewell, then how do you run the script?04:52
psychotropechmod and ./04:52
psychotropevery simple stuff04:52
shorneyou always type out... ./path/to/my/script/do-something-cool.sh04:52
shornethats not being lazy04:53
psychotropewell generally its in a folder04:53
psychotropeor I'll but it in some bin folder04:53
shornelazy programmers will do04:53
shorneexport PATH=$PATH:$HOME/path/to/my/scripts04:53
shornethen just type 'do-something-cool.sh'04:53
psychotropehmm, so it makes it callable system-wide04:54
psychotropedamn04:54
psychotropethat is actually super helpful04:54
shorneit makes it callable to your current shell04:54
psychotropeI guess I don't know what I don't know04:54
psychotropewell yeah04:54
shorneto get it remembered every time you login you add to your '.bash_profile'04:55
psychotropebut dang, I've been using linux for 3 years and never heard or use that other than blindly plugging it in to install something04:55
shornebuy a linux book, that should be first chapter04:55
shorneif its not buy another book :)04:55
shorneenvironment variables, and setting up your profile04:56
shornevery useful04:56
psychotropesounds like it04:57
psychotropemeanwhile my mouse just died04:58
psychotropethats not helpful04:58
psychotropeokay, back to musl04:59
psychotropeI;ll go read up on path real quick04:59
psychotropeso for export PATH=$PATH:<location of musl>/bin, should direction of musl be the folder or something within it?05:00
psychotrope*location05:00
shornewell, which folder under your extracted musl folder has or1k-linux-musl-gcc?05:03
psychotropeits under bin05:05
shorneyeah, so you need to put the full path in PATH, not relative path05:05
shorneyou can use $PWD05:05
shornethats the current working directory05:05
psychotropeso $pwd/or1k-linux-gcc?05:06
psychotropeit would appear so...05:07
shornewell need CAPs for PWD05:07
psychotropewell yeah05:08
shorneand you need to include the BIN... and why does it day or1k-linux-gcc?05:08
shornelike $PWD/or1k-linux-musl/bin05:08
shorneyou can always test with this05:08
shorne'ls $PWD/or1k-linux-musl/bin'05:08
shorneif that lists the directory contents then its right05:08
shorneand you see 'the *gcc bin' its good, if not you need to try again05:09
psychotropeokay musl/or1k-linux-musl/bin is in my path enviroment variable05:12
psychotropecool05:12
psychotropeI have no idea why that took me so long05:13
psychotropeother than my mouse decided to die for no apparent reason05:13
shorneok, now you can just run 'or1k-linux-musl-gcc' in any directory and get something?05:14
psychotropeyep05:15
psychotropeno input files error ofc05:15
psychotropeso it works05:15
shornegood05:15
shorneok, now you can compile some binaries for the openrisc target05:15
shornelinux05:15
psychotropecool05:15
shorneit was just like 2 steps to do it :)05:16
shorne1. install the binary05:16
shorne2. setup your path05:16
psychotropeyeah I'm being tired and making dumb mistakes that are slowing me down like crazy05:16
psychotropesorry about that05:16
shornenext try to go into one of the library folders and see what you have05:17
shorneis it an autoconf project>05:17
shorne?05:17
psychotropeso what should I do about those libraries, how do I get them to so that I can use them while compiling GPG with musl?05:17
shornewith configure and make?05:17
psychotropeI'll check05:17
shornewell, you have to compile them first too05:18
psychotropelibgcrypt uses configure and make05:19
shorneso try05:19
psychotropewell these libraries seem dependent on eachother05:19
psychotropehmm...05:19
shorne./configure --target=or1k=linux-musl- --prefix=<place you want>/openrisc/musl-libs05:20
shornewell it shouldn't be on eachother gpg-->libcrypt-->something05:20
shorneyou need to compile in reverse order05:20
psychotropeyeah libgcrypt needed libgpg-error05:21
psychotropeI assumed the libraries were independent05:21
psychotropeif I leave out prefix, it just puts things in my current directory right?05:22
psychotropewhen I ./configure --target=or1k=linux-musl- , it finishes telling me my platform is X8605:24
psychotropesomething isn't right here...05:24
shornehmm yeah05:24
shornewell, which project did you try?05:25
psychotropelibgpg-error05:25
psychotropeit worked fine, but when I ran ./configure --target=or1k=linux-musl- --prefix=, it gave me X8605:26
psychotrope...idk05:26
psychotropewithouth the prefix part05:26
psychotropesilly copy paste05:26
shornelet ms see05:26
shorneyou might need ./configure --target=or1k=linux-musl- --host=or1k05:28
shornealways look at ./configure --help05:28
psychotropeokay05:28
shornePlatform: or1k-unknown-none05:29
shornehmm, it seems there is an architecture specific layer here05:29
psychotropeyeah under system types, ./configure --help says to use --host=HOST05:29
psychotropeI assume you're trying things on your end with libgpg-error05:29
shorneno I guess it works05:30
shorneI just tried05:30
shorneit builds fine05:30
psychotropeso ./configure --target=or1k=linux-musl- --host=or1k?05:30
shorneI did05:31
shorne./configure --target=or1k-linux-musl- --host=or1k --prefix=$HOME/openrisc/libs05:31
shornethen make && make install05:31
psychotropeseemed to work05:32
psychotropecool05:32
shorneoh good they have -config binaries (like pkg config)05:32
shornethat means library dependency basically works via $PATH too05:32
psychotrope*sigh* I pointed it to my home directory with and no a folder there, now I have to find the output files lol05:34
psychotropeI could not be more of a idiot05:34
shorneyou can fix the path and try again05:36
psychotropethe outputs should have been "bin", "share", "lib" and "include" correct?05:36
shorneyeah05:36
shorneyou can just remove those from your home05:36
psychotropeI just moved them manually05:36
shorneyeah05:36
shornehmm, target did not work on this build05:38
psychotropeon what build?05:38
psychotrope./configure, make && make install worked for me05:38
psychotropefor libgpgerror05:38
psychotropewell I have the files from libgpgerror in a folder /home/project/compiledlibs/libgpgerror05:40
psychotropebut now I need them for libgcrypt05:40
shorneI was wrong05:42
shorne./configure --host=or1k-linux-musl05:42
shorneneed to use that05:42
psychotropeso get rid of the old libgpgerror I assume05:42
shornewhat we did before installed binaries for x86 still05:42
shorneyeah05:42
psychotrope        Revision: 82266de  (33318)05:45
psychotrope        Platform: or1k-unknown-linux-musl05:45
psychotropesound right?05:45
shorneyeah05:45
shornebut... it wont build05:45
psychotropeyeah...05:46
psychotropeI can see05:46
shornethere are host specific libs here src/syscfg/lock-obj-pub.*05:46
shorneneed to create code for openrisc specifically05:46
shorneyou can do it  :)05:46
shorneand send patches05:46
shorneoh, its there05:46
shorne lock-obj-pub.or1k-unknown-linux-gnu.h05:47
psychotropeso... where should I start05:48
psychotropeobviously that ./configure isn't getting anyone anywhere05:48
shornewell I tried a hack05:49
shornecp src/syscfg/lock-obj-pub.or1k-unknown-linux-gnu.h src/syscfg/lock-obj-pub.or1k-unknown-linux-musl.h05:49
shorneand make05:49
psychotropenope05:49
psychotropewhy is nios2 in src/syscfg05:51
shorneI guess read README05:51
shornethe syscfg seems to have details for system specifc locks05:51
shornei.e. each CPU needs different code (assembly level) for doing locks05:52
shornethe README has a section on Cross Compiling05:53
shorneI think I have to leave you there05:53
psychotropeokay05:53
psychotropeI'll read up and try some more tomorrow05:53
psychotropethink you'll be around this weekend?05:53
shornehmm, maybe not much, its saturday night for me05:54
shornetomorrow big party05:54
psychotropeokay, well thanks for all the help, I'll continue reading up on things and see if I can make progress05:54
psychotropethanks again for all the help05:54
shornepsychotrope: btw, this is the device tree (system on chip description) of de0 nano https://github.com/openrisc/linux/blob/master/arch/openrisc/boot/dts/de0_nano.dts06:28
psychotropeshorne: awesome06:29
shornenotice the SPI bus is used for flash06:29
shorneincluding FPGA image + bootloader06:29
psychotropehow big is the flash in total?06:29
shorneyou can look it up06:30
shornealso it says there06:30
psychotropeyeah I noticed06:31
psychotropenvm06:31
psychotropein the flash notes06:31
psychotrope"free space"06:31
shorne0x0070000006:31
psychotrope64mbits total06:35
psychotropeso thats only 8 megabyte06:36
psychotropeexcluding the bitstream and config tools06:36
psychotropeI'll think about this later, I'm off to bed06:36
olofkshorne: You're doing an absolutely fantastic work with all the maintenance. Big thanks for that17:08
olofkshorne: And also, I just saw CONFIG_INITRAMFS_SOURCE reading through the backlog. So that's the way to use an initrams outside of the linux tree? I've been looking for that for years17:11
olofkwbx: Regarding the things that shorne is trying to help psychotrope with, wouldn't buildroot be quite helpful here in collecting the dependencies and do lot of the heavy work?17:23
olofkAlso, poke53281 has a collection of scripts (like an ad-hoc buildroot/yocto) that he used to get packages compiled for jor1k. Maybe the pgp (or is it gpg?) stuff is in there somewhere?17:24
shorneolofk: you can always redirect the initramfs to another place I do CONFIG_INITRAMFS_SOURCE="../openrisc/openrisc_os/initramfs ../openrisc/openrisc_os/initramfs.devnodes"17:48
shornethats what the builtroot stuff is for, it builds that directory I think, then you just point INITRAMFS to there17:48
shorneolofk: I could commit the scripts I have in openrisc_os17:49
olofkThat's really useful. I've always found it a bit awkward to have to cram all your files into the linux build tree when creating custom initramfs17:49
shornebut its not that great, I guess buildroot or whatever is what I should be trying to use there17:50
shorneolofk: with regard to psychotrope buildroot is probably going to be better17:52
shorneits good to know what PATH is and what ./configure does though17:52
olofksure, but anything involving multiple levels of library dependencies is going to be a pain :)17:56
olofkIf only something like FuseSoC existed for software :)17:56
olofkoh well. Time to go now17:57
olofkAlmost forgot, happy birthday stekern_ :)17:57
olofkGood night17:57
shornenight17:58
shornestekern_: I rebased smp patches on the latest kernel (after openrisc merges)18:19
shorneIt compiles after some patches, but I have some work to do I think18:20
shornehttps://github.com/stffrdhrn/linux/wiki/OpenRISC-SMP-&-driver-branches18:20
shorneI tried to document here, for SMP and Drivers are rebased and separated out to branches for easy integration, also they probably will not all to in through our tree18:20
--- Log closed Sun Feb 26 00:00:17 2017

Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!