Go to advanced search

by Bakul Shah
Mon Apr 29, 2013 7:27 am
Forum: Troubleshooting
Topic: USB redux
Replies: 514
Views: 209177

Re: USB redux

The crux of the matter is, the hardware within the R-pi was never intended to be a PC-level host. The Designware OTG controller is just that - an on-the-go USB controller which has "dual role" capability - in that it can act as either a host or a device - but as an OTG host would only ever be expec...
by Bakul Shah
Fri Apr 26, 2013 9:35 am
Forum: Off topic discussion
Topic: Parallella: A Supercomputer For Everyone
Replies: 156
Views: 47127

Re: Parallella: A Supercomputer For Everyone

Designing school timetables is notoriously difficult. Timetable construction is an NP-complete problem. See Jeff Kingston's paper on timetable construction complexity. Available on his home page @ Uni of Sydney. It also points to some free software for High school timetabling. A good survey o timet...
by Bakul Shah
Wed Apr 24, 2013 7:13 am
Forum: Off topic discussion
Topic: Parallella: A Supercomputer For Everyone
Replies: 156
Views: 47127

Re: Parallella: A Supercomputer For Everyone

Extracting parallelism from general programs is incredibly hard and may be impossible. However, there are many problems that are inherently parallel (some kinds of image processing, wind tunnel simulation, weather simulation, quantum chromodynamics) and mapping them onto a parallel machine is not h...
by Bakul Shah
Sun Apr 21, 2013 7:54 pm
Forum: General discussion
Topic: How fast (slow) is the Rasperry Pi?
Replies: 37
Views: 6117

Re: How fast (slow) is the Rasperry Pi?

Engineering is not about an "ideal" design but about "good enough" design [..] My work ethic revolves around the concept of personal pride in one's work and "good enough" is never good enough; you should always do your best. You misunderstand. Pride in one's work and a good enough design are not in...
by Bakul Shah
Sat Apr 20, 2013 11:05 pm
Forum: General discussion
Topic: How fast (slow) is the Rasperry Pi?
Replies: 37
Views: 6117

Re: How fast (slow) is the Rasperry Pi?

This is of course not meant as criticism of the Raspberry Pi, far from it. Merely putting things into perspective. The Pi was designed with certain use cases in mind. It's perhaps not the ideal platform for video editing or number crunching. ;) It really depends. Engineering is not about an "ideal"...
by Bakul Shah
Sat Apr 20, 2013 7:47 pm
Forum: Plan 9
Topic: keyboard problems
Replies: 4
Views: 19178

Re: keyboard problems

If you keyboard is in the list on this page http://elinux.org/RPi_VerifiedPeripherals then start looking at power issues. Note that this list is for Linux . Many peripherals on this list don't work on Plan9. I have the same microsoft 2000 keyboard and can conform it doesn't work. I just use another...
by Bakul Shah
Fri Apr 12, 2013 10:17 pm
Forum: Plan 9
Topic: the swedish chef and his kbmap
Replies: 1
Views: 12921

Re: the swedish chef and his kbmap

I don't see a swedish kbmap in /sys/lib/kbmap but there is a /sys/lib/kbmap/no -- may be you can create /sys/lib/kbmap/se from it? The format of this file seems pretty simple: table# scancode unicode . IIRC table 0 is unshifted, 1 is shifted, 2 is alt, 3 is altgr, 4 is control. "man 3 kbmap" for det...
by Bakul Shah
Sun Apr 07, 2013 4:14 pm
Forum: General programming discussion
Topic: Another possible method to access GPIO
Replies: 20
Views: 3736

Re: Another possible method to access GPIO

It depends. Convenience functions for your own use are best left in bashrc instead of cluttering up ~/bin. If they evolve into something more useful, you can move them to your own bin and clean them up a bit, add usage and so on. If they are more generally useful they can migrate to a more general p...
by Bakul Shah
Sun Apr 07, 2013 3:56 pm
Forum: General programming discussion
Topic: Another possible method to access GPIO
Replies: 20
Views: 3736

Re: Another possible method to access GPIO

For interactive use you can stick them in ~/.bashrc. If you want to use them from other scripts, stick them in a file and set env var BASH_ENV to the path for this file. See bash manpage for exact details. Edit: if you add new definitions to .bashrc, to make them visible in your currently running sh...
by Bakul Shah
Sun Apr 07, 2013 3:36 pm
Forum: General programming discussion
Topic: Another possible method to access GPIO
Replies: 20
Views: 3736

Re: Another possible method to access GPIO

Instead of all this rigmarole, you can just use functions. For instance setpin() { echo $2 >/sys/class/gpio/gpio$1/value } Or if you prefer, setpin() { sudo sh -c "echo $2 >/sys/class/gpio/gpio$1/value" } Though I generally don't like embedding dangerous commands like sudo in scripts or functions. I...
by Bakul Shah
Tue Apr 02, 2013 9:41 am
Forum: Bare metal, Assembly language
Topic: Memory Paging
Replies: 16
Views: 6623

Re: Memory Paging

That said, I was reading about memory paging, and I asked myself the following question: is there anyway to access a concrete physical address from a program? I was looking how GPIO were accessed, and I saw some references to 0x20000000 (BCM2708_PERI_BASE), and I thought: how does the MMU know when...
by Bakul Shah
Mon Apr 01, 2013 6:55 am
Forum: HATs and other add-ons
Topic: Setup code rejected by C++ compiler
Replies: 10
Views: 2547

Re: Setup code rejected by C++ compiler

Why not just use char* gpio_mem_orig = new char[BLOCK_SIZE + PAGE_SIZE-1]; malloc() returns a void* and while C allows assigning it to any pointer, C++ doesn't. You should use new in C++ as malloc() is a C-ism (though if I were you, I'd just leave the original C alone and wrap a corresponding header...
by Bakul Shah
Sun Mar 31, 2013 8:20 pm
Forum: Bare metal, Assembly language
Topic: Memory Paging
Replies: 16
Views: 6623

Re: Memory Paging

So swapping to/from disk (or not) is a side effect of a page fault meaning an application accessed a memory page that was marked as protected from that application. As a historical note and terminology nit, when I first started on unix, way back in the late 70s, they didn't have virtual memory. The...
by Bakul Shah
Sun Mar 31, 2013 6:17 pm
Forum: Other projects
Topic: LambdaPi
Replies: 9
Views: 4376

Re: LambdaPi

Given that you are compiling to asm, is there any benefit to flat closures? As opposed to? One way or another, I need to implement closures, flat closures give a handy speed boost at the cost of additional memory usage. As opposed to just storing a static link (to the lexically closest surrounding ...
by Bakul Shah
Sat Mar 30, 2013 12:03 am
Forum: Other projects
Topic: LambdaPi
Replies: 9
Views: 4376

Re: LambdaPi

Good to see this progress, Simon!

Given that you are compiling to asm, is there any benefit to flat closures?
by Bakul Shah
Thu Mar 28, 2013 8:10 am
Forum: Troubleshooting
Topic: borderline sdcard or a bug?
Replies: 2
Views: 575

borderline sdcard or a bug?

Strange symptom: I can read/write an SDcard fine on a Mac but it will no longer boot the RPi it was plugged in for the last 9 months or so. This particular RPi worked fine until the last RPI-update. What happens is the green LED blinks 3 times in rapid succession every few seconds. [This supposedly ...
by Bakul Shah
Tue Mar 19, 2013 8:47 pm
Forum: Networking and servers
Topic: WiFi, Ethernet and routing
Replies: 4
Views: 1708

Re: WiFi, Ethernet and routing

You don't need any IGP as you have a single internal network (the ADSL router "routes" your external traffic but acts as a bridge for internal traffic). What does ifconfig on the PC and Pi reveal? They should have the same net and netmask. There are a number of possibilities. You can run tcpdump on ...
by Bakul Shah
Tue Mar 19, 2013 6:02 pm
Forum: Networking and servers
Topic: WiFi, Ethernet and routing
Replies: 4
Views: 1708

Re: WiFi, Ethernet and routing

Is your "router" a real router (passes packets between different subnets) or a bridge (passes packets between hosts on the same subnet)? ARP only works on the same subnet. Show us your net topology. Something like skys+-box[a]-------- RPi[c]~~~~wifi~~~~[d]"router"[e]--------[f]desktop PC Your router...
by Bakul Shah
Tue Mar 12, 2013 7:18 am
Forum: General discussion
Topic: Accessing GPIO which is fastest?
Replies: 5
Views: 1549

Re: Accessing GPIO which is fastest?

I should think SPI + DMA would be the fastest + the ARM needs far fewer interrupts. Even if you don't use DMA, SPI has a 16 word fifo which means it will need attention much less frequently (compared to a parallel ADC on the GPIO). Both leave you enough time to do other things (may be even do spectr...
by Bakul Shah
Sat Feb 16, 2013 6:32 pm
Forum: Staffroom, classroom and projects
Topic: Assembly - any use in teaching it?
Replies: 138
Views: 35034

Re: Assembly - any use in teaching it?

We use large FPGA devices when developing the next generation GPU chips. The whole GPU is testing in FPGA (the boxes are really quite large ie they have wheels, as we need somewhat more than 200k gates) prior to tapeout so we know they 'work' before spending $750k on masks etc. The last time I was ...
by Bakul Shah
Wed Feb 13, 2013 6:09 pm
Forum: Linux Kernel
Topic: Time to compile the kernel
Replies: 16
Views: 7798

Re: Time to compile the kernel

Thanks. Compiling the default raspian kernel on the RPi takes over 10 hours.
by Bakul Shah
Tue Feb 12, 2013 11:49 pm
Forum: Staffroom, classroom and projects
Topic: Assembly - any use in teaching it?
Replies: 138
Views: 35034

Re: Assembly - any use in teaching it?

My point was that the programmer must not assume that when they write code that they believe can be converted to efficient assembler code, that the compiler will compile to that code. But more importantly, it is not necessary to write obscure code in order to ensure that the compiled code is effici...
by Bakul Shah
Tue Feb 12, 2013 11:34 pm
Forum: Staffroom, classroom and projects
Topic: Assembly - any use in teaching it?
Replies: 138
Views: 35034

Re: Assembly - any use in teaching it?

For that reason "*p++ = *p++ + y" can't be converted to "*p++ += y". In C, at least, it can. You have two assignments to p with no intervening sequence point there, so the behaviour is undefined, and the compiler can emit whatever it likes. Good catch! But there is such a thing as quality of implem...
by Bakul Shah
Tue Feb 12, 2013 6:30 pm
Forum: Staffroom, classroom and projects
Topic: Assembly - any use in teaching it?
Replies: 138
Views: 35034

Re: Assembly - any use in teaching it?

... I've seen a compiler take "x += y" and calculate the address of x twice, and it was a complex array access so non-trivial. OK, when I switched on optimisation it got it right, but it would have worked just as well with "x = x + y". Yikes! That's a compiler error. What if the calculation of x ha...
by Bakul Shah
Tue Feb 12, 2013 6:11 pm
Forum: Staffroom, classroom and projects
Topic: BASIC - more harmful than useful?
Replies: 899
Views: 153931

Re: BASIC - more harmful than useful?

Or are you saying that . is a low level operator? I believe that CAR, CDR, CONS are the lowest level operators, and that . is in fact a function of the input parser and output formatter. Indeed. The low level memory allocator in a pure lisp (i.e. one without additional low level data types like arr...

Go to advanced search