http://embeddedcomputer.nl/lanotattachments/download/file/id/3/store/1/
Booting Ubuntu on BeagleBoard Black
http://circuitco.com/support/index.php?title=Booting_Ubuntu_on_BeagleBoard_Black
Linux on ARM / Home:
http://eewiki.net/display/linuxonarm/BeagleBone+Black
uEnv.txt based bootscript:
Beaglebone Black CircuitCo support page:
http://circuitco.com/support/index.php?title=BeagleBoneBlack
BeagleBone Boot Sequence.
http://elinux.org/EBC_Exercise_21a_Boot_Sequence#Booting_Up
Unbrick
http://hipstercircuits.com/unbrick-beaglebone-black-without-erasing-emmc/
Angstrom Cloud9 distribution download
http://downloads.angstrom-distribution.org/demo/beaglebone/
Burning an IMG File
http://doc.freenas.org/index.php/Burning_an_IMG_File
6+ hour:
Building Angstrom for Beaglebone from Source:
http://derekmolloy.ie/building-angstrom-for-beaglebone-from-source/
http://nomel.tumblr.com/post/30357133735/beaglebone-tutorial-how-to-compile-kernel-modules-and
Showing posts with label OS. Show all posts
Showing posts with label OS. Show all posts
Monday, September 30, 2013
Saturday, September 28, 2013
Create Partion and Filesystems
Divide and conquer your disk space
http://www.ibm.com/developerworks/library/l-lpic1-v3-104-1/
http://www.ibm.com/developerworks/library/l-lpic1-v3-104-1/
Friday, September 27, 2013
Beaglebone USB Ethernet Connection
http://robotic-controls.com/learn/beaglebone/beaglebone-internet-over-usb-only
http://shallowsky.com/blog/hardware/talking-to-beaglebone.html
On the beaglebone:
Once your network is running, you might want to run
Scripts for configuration after automatic connection
http://www.circuidipity.com/getting-started-with-beaglebone-black.html
http://shallowsky.com/blog/hardware/talking-to-beaglebone.html
On the beaglebone:
/sbin/route add default gw 192.168.7.1 echo "nameserver 8.8.8.8" >> /etc/resolv.confYou'll probably want to add these lines to the end of /usr/bin/g-ether-load.sh on the BBB, so they'll be run automatically every time you boot. Then, back on your Linux host, do this:
sudo iptables -A POSTROUTING -t nat -j MASQUERADE echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/nullNow you should be able to ping, ssh or otherwise use the BBB to get anywhere on the net.
Once your network is running, you might want to run
/usr/bin/ntpdate -b -s -u pool.ntp.org
to set the time, since the BBB doesn't have a real-time clock (RTC).Scripts for configuration after automatic connection
http://www.circuidipity.com/getting-started-with-beaglebone-black.html
Tuesday, September 24, 2013
interrupt, Callback, Software Debounce, RPi
raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio-part-2
Wednesday, September 18, 2013
How kernel compiler c library work together
http://wiki.osdev.org/How_kernel,_compiler,_and_C_library_work_together
Labels:
C/C++,
compiler,
Kernel,
Linux,
OS,
Programming,
Software Engineering
Tuesday, September 17, 2013
Difference between .o and .ko file
http://stackoverflow.com/questions/10476990/difference-between-o-and-ko-file
The short answer is that the .ko file is your
object file linked with some kernel automatically generated data
structures that are needed by the kernel.
The .o file is the object file of your modules - the result of compiling your c files. The kernel build system then automatically creates another C file with some data structures describing the kernel module (named your_module_kmod.c), compile this C file into another object file and links your object file and the object file it built together to create the .ko file.
The dynamic linker in the kernel that is in charge of loading kernel modules, expects to find the data structure the kernel put in the kmod object in the .ko file and will not be able to load your kernel module without them
The .o file is the object file of your modules - the result of compiling your c files. The kernel build system then automatically creates another C file with some data structures describing the kernel module (named your_module_kmod.c), compile this C file into another object file and links your object file and the object file it built together to create the .ko file.
The dynamic linker in the kernel that is in charge of loading kernel modules, expects to find the data structure the kernel put in the kmod object in the .ko file and will not be able to load your kernel module without them
Sunday, September 15, 2013
Disabling the beaglebone black HDMI Cape
mount /dev/mmcblk0p1 /mnt/card
Edit the uEnv.txt on the mounted partition:
nano /mnt/card/uEnv.txt
To disable the HDMI Cape, change the contents of uEnv.txt to:
optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN
Save the file:
Ctrl-X, Y
Unmount the partition:
umount /mnt/card
Reboot the board:
shutdown -r now
Wait about 10 seconds and reconnect to the BeagleBone Black through SSH. To see what capes are enabled:
cat /sys/devices/bone_capemgr.*/slots
Every line shows something like “P-O-L” or “P-O–”. The letter “L” means
the Cape is enabled; no letter “L” means that it is disabled. You can
see here that the HDMI Cape has been disabled, so pin 27 to 46 on header
P8 are now available to use
http://www.logicsupply.com/blog/2013/07/18/disabling-the-beaglebone-black-hdmi-cape/
Sunday, September 8, 2013
Function Pointers and Callback in C
http://www.linuxforu.com/2012/02/function-pointers-and-callbacks-in-c-an-odyssey/
http://www.learncpp.com/cpp-tutorial/78-function-pointers/
typedef....
http://www.learncpp.com/cpp-tutorial/78-function-pointers/
typedef....
Friday, August 23, 2013
sync folders over remote placeT
http://www.finiteloops.com/weblog/?p=111
rsync -avze ssh /localpath(source)/ user@remoteaddress:/remotepath/(destination)
rsync -avze ssh /localpath(source)/ user@remoteaddress:/remotepath/(destination)
Tuesday, August 20, 2013
Static Library .a and Dynamic Library .so
http://www.ilkda.com/compile/Static_Versus_Dynamic.htm
Creating .so and .a in Unix
http://stackoverflow.com/questions/1648215/creating-so-and-a-in-unix
Creating .so and .a in Unix
http://stackoverflow.com/questions/1648215/creating-so-and-a-in-unix
Friday, August 16, 2013
mkimage command not found
http://shuiqingwang.blogspot.com/2012/07/solvedmkimage-command-not-found-u-boot.html
Problem: "mkimage" command not found - U-Boot images will not be built
Solution: sudo apt-get install uboot-mkimage
make the kernel again
http://forkbomb.dadacafe.org/blog/__34__mkimage__34___command_not_found_-_U-Boot_images_will_not_be_built/
http://processors.wiki.ti.com/index.php/Linux_Toolchain
Problem: "mkimage" command not found - U-Boot images will not be built
Solution: sudo apt-get install uboot-mkimage
make the kernel again
http://forkbomb.dadacafe.org/blog/__34__mkimage__34___command_not_found_-_U-Boot_images_will_not_be_built/
http://processors.wiki.ti.com/index.php/Linux_Toolchain
Friday, August 9, 2013
Anatomy of real-time Linux architecture
http://www.ibm.com/developerworks/library/l-real-time-linux/
An operating system that can support the desired deadlines of the real-time tasks (even under worst-case processing loads) is called a hard real-time system. But hard real-time support isn't necessary in all cases. If an operating system can support the deadlines on average, it's called a soft real-time system. Hard real-time systems are those in which missing a deadline can have a catastrophic result (such as deploying an airbag too late or allowing brake pressure to slip for too long). Soft real-time systems can miss deadlines without the overall system failing (such as losing a frame of video).
Although the thin kernel approach has its advantages (hard real-time support coexisting with a standard Linux kernel), the approach does have drawbacks. The real-time and non-real-time tasks are independent, which can make debugging more difficult. Also, non-real-time tasks do not have full Linux platform support (the thin kernel execution is called thin for a reason).
Examples of this approach include RTLinux (now proprietary and owned by Wind River Systems), Real-Time Application Interface (RTAI), and Xenomai.
This approach adds a module to a kernel to provide reservations for various types of resources. The reservations guarantee access to time-multiplexed system resources (CPU, network, or disk bandwidth).
Using a scheduling algorithm such as Earliest-Deadline-First (EDF), the kernel can then be used to handle the dynamic scheduling workload.
Today, in the 2.6 kernel, you can get soft real-time performance through a simple kernel configuration to make the kernel fully preemptable (see Figure 6). In the standard 2.6 Linux kernel, when a user space process makes a call into the kernel (through a system call), it cannot be preempted.
The new configuration option
CONFIG_PREEMPT changes this behavior of the kernel by allowing processes to be preempted if high-priority work is available to do (even if the process is in the middle of a system call).
Trade-off
Although the option enables soft real-time performance and even under load makes the operating system execute more smoothly,
it does so at a cost. That cost is slightly lower throughput and a small reduction in kernel performance because of the added overhead of the
CONFIG_PREEMPT option. This option is useful for desktop and embedded systems, but it may not be right in all scenarios (for example, servers).
Kernel 2.6 for high resolution timers
1us resolution (if supported by underlying hardware)
Timer management (implemented with Red-black tree) for efficiency.
O(1) scheduler
Preempt_RT Patch
The PREEMPT_RT patch provides several modifications to yield hard real-time support.
Reimplementing some of the kernel locking primitives to be fully preemptable,
Priority Inheritance
in kernel mutexes, and converting interrupt handlers into kernel threads so that they are fully preemptable
This article gave a brief overview of some of the techniques used to bring real-time computing to the Linux kernel. Numerous early attempts used a thin-kernel approach to segregate the real-time tasks from the standard kernel. Later, nano-kernel approaches came on the scene that appear very much like the hypervisors used in virtualization solutions today. Finally, the Linux kernel provides its own means for real time, both soft and hard.
Saturday, August 3, 2013
Scheduling Computing and Pipe/pipeline (Unix)
https://en.wikipedia.org/wiki/Scheduling_(computing)
Some scheduling disciplines
First in first out
Shortest Remaining time
Fixed priority pre-emptive scheduling
Round robin
Multilevel queue
Manual Scheduling
In real time environments, such as embedded systems for
the scheduler also must ensure that processes can meet deadlines; this is crucial for keeping the system stable
https://en.wikipedia.org/wiki/Pipeline_(Unix)
In most Unix-like systems, all processes of a pipeline are started at the same time, with their streams appropriately connected, and managed by the scheduler together with all other processes running on the machine. An important aspect of this, setting Unix pipes apart from other pipe implementations, is the concept of buffering: for example a sending program may produce 5000 bytes per second, and a receiving program may only be able to accept 100 bytes per second, but no data is lost. Instead, the output of the sending program is held in a queue. When the receiving program is ready to read data, the operating system sends its data from the queue, then removes that data from the queue. If the queue buffer fills up, the sending program is suspended (blocked) until the receiving program has had a chance to read some data and make room in the buffer. In Linux, the size of the buffer is 65536 bytes.
Some scheduling disciplines
First in first out
Shortest Remaining time
Fixed priority pre-emptive scheduling
Round robin
Multilevel queue
Manual Scheduling
In real time environments, such as embedded systems for
the scheduler also must ensure that processes can meet deadlines; this is crucial for keeping the system stable
https://en.wikipedia.org/wiki/Pipeline_(Unix)
In most Unix-like systems, all processes of a pipeline are started at the same time, with their streams appropriately connected, and managed by the scheduler together with all other processes running on the machine. An important aspect of this, setting Unix pipes apart from other pipe implementations, is the concept of buffering: for example a sending program may produce 5000 bytes per second, and a receiving program may only be able to accept 100 bytes per second, but no data is lost. Instead, the output of the sending program is held in a queue. When the receiving program is ready to read data, the operating system sends its data from the queue, then removes that data from the queue. If the queue buffer fills up, the sending program is suspended (blocked) until the receiving program has had a chance to read some data and make room in the buffer. In Linux, the size of the buffer is 65536 bytes.
Saturday, July 27, 2013
Untar all files in a directory
#!/bin/bash
for a in `ls -1 *.tar.*`
do
tar -zxvf $a
done
http://castyour.net/untar-all-files-directory
Bash for loop examples
http://www.cyberciti.biz/faq/bash-for-loop/
Other arguments
http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/
tar error - 'Child returned status 1'
http://www.linuxquestions.org/questions/linux-newbie-8/tar-error-'child-returned-status-1'-208083/
You used "tar -zxvf" for the second command. the 'z' option tells tar to use gzip to uncompress the file. Since you already uncompressed it in the first command, gzip doesn't know what to do with it, and it consequently croaks. Tar stops because gzip encountered a problem. So, with the file you have now, you would extract it with:
tar -xvf xxxxxx.x.x.tar
I would go back and re-gzip the tar file though (to save space):
gzip xxxxxx.x.x.tar
tar -zxvf xxxxxx.x.x.tar.gz
The first step uncompresses the tar ball.
In the second step, tar is expecting a compressed tar ball (.tar.gz).
You can either do:
for an uncompressed tar ball
or
for a compressed tar ball, as the z switch uncompresses the tar ball using gzip.
I hope this helps
--Ian
for a in `ls -1 *.tar.*`
do
tar -zxvf $a
done
http://castyour.net/untar-all-files-directory
Bash for loop examples
http://www.cyberciti.biz/faq/bash-for-loop/
Other arguments
http://www.thegeekstuff.com/2010/04/unix-tar-command-examples/
tar error - 'Child returned status 1'
http://www.linuxquestions.org/questions/linux-newbie-8/tar-error-'child-returned-status-1'-208083/
You used "tar -zxvf" for the second command. the 'z' option tells tar to use gzip to uncompress the file. Since you already uncompressed it in the first command, gzip doesn't know what to do with it, and it consequently croaks. Tar stops because gzip encountered a problem. So, with the file you have now, you would extract it with:
tar -xvf xxxxxx.x.x.tar
I would go back and re-gzip the tar file though (to save space):
gzip xxxxxx.x.x.tar
tar -zxvf xxxxxx.x.x.tar.gz
The first step uncompresses the tar ball.
In the second step, tar is expecting a compressed tar ball (.tar.gz).
You can either do:
Code:
tar -xvf fileName.tar
or
Code:
tar -xzvf fileName.tar.gz
I hope this helps
--Ian
Friday, July 19, 2013
Quick Guide to Using DoxyGen in Ubuntu
PhpDocumentor was easy to setup with the pear module, but I just couldn’t get past the “nothing parsed” error. So I moved on to Doxygen
It might not be as mature, but hey, it works and thats what matters
1. sudo apt-get install doxygen doxygen-gui
2. in terminal doxygenwizard& will launch the gui
OR (from Life of a Programmer Geek)
2. cd project directory
3. doxygen -g
4. edit Doxyfile
Labels:
Linux,
OS,
Programming,
Software,
Software Engineering
Thursday, July 18, 2013
Fortran Garbage Collector
http://stackoverflow.com/questions/13966955/does-fortran-have-a-garbage-collectorgc/13967374#13967374
Modern Fortran has many ways of declaring variables. Items simply declared will exist for the duration of the scope of the entity. So "real, dimension (N) :: array" declared in a procedure will automatically disappear when that procedure returns. Naturally variables declared in the main program or module variables or common (outmoded) will persist for the duration of the program.
allocate -- dynamic allocate
Variables can be dynamically allocated with "allocate" (to do so, they have to be declared with the allocatable attribute). Since Fortran 95 allocatable variables that are local to a procedure are automatically deallocated when the procedure returns! They will not leak memory! (Some programmers might consider it good practice to explicitly deallocate the variables anyway, even though it isn't strictly necessary.) (Of course, you can waste memory in the sense of not explicitly deallocating a variable that you know that you don't need anymore.)
t is possible to leak memory with pointers. You can allocate memory with a pointer, then assign the pointer to to another variable, losing the previous association. If you didn't deallocate that memory you have a leak. The need for pointers is less in Fortran than in some other languages ... many things can be done with allocatable variables, which are safer -- no memory leaks
http://stackoverflow.com/questions/2300199/allocatable-arrays-or-pointer-arrays
Allocatable arrays Vs Pointer arrays?
Allocatable arrays can result in more efficient code because the arrays will be contiguous. Particularly if the array is passed to a subroutine, being contiguous can prevent the need for the compiler creating a temporary copy. For local variables in subroutines (without the SAVE attribute) (for Fortran 95 and higher), allocatable arrays are automatically deallocated upon exit from the subroutine, avoiding a memory leak. Memory leaks aren't possible with allocatables, except in the sense of the programmer not deallocating an array that is no longer need. With pointers, you can reassign a pointer, leaving some memory inaccessible and lost -- one form of a leak. If an allocatable will do the job, I recommend using that method instead of a pointer. Some reasons to use pointers: taking a section of an array, or creating a data structure such as a linked list. For the purpose of creating an array of size determined at run time, I'd use an allocatable.
Modern Fortran has many ways of declaring variables. Items simply declared will exist for the duration of the scope of the entity. So "real, dimension (N) :: array" declared in a procedure will automatically disappear when that procedure returns. Naturally variables declared in the main program or module variables or common (outmoded) will persist for the duration of the program.
allocate -- dynamic allocate
Variables can be dynamically allocated with "allocate" (to do so, they have to be declared with the allocatable attribute). Since Fortran 95 allocatable variables that are local to a procedure are automatically deallocated when the procedure returns! They will not leak memory! (Some programmers might consider it good practice to explicitly deallocate the variables anyway, even though it isn't strictly necessary.) (Of course, you can waste memory in the sense of not explicitly deallocating a variable that you know that you don't need anymore.)
t is possible to leak memory with pointers. You can allocate memory with a pointer, then assign the pointer to to another variable, losing the previous association. If you didn't deallocate that memory you have a leak. The need for pointers is less in Fortran than in some other languages ... many things can be done with allocatable variables, which are safer -- no memory leaks
http://stackoverflow.com/questions/2300199/allocatable-arrays-or-pointer-arrays
Allocatable arrays Vs Pointer arrays?
Allocatable arrays can result in more efficient code because the arrays will be contiguous. Particularly if the array is passed to a subroutine, being contiguous can prevent the need for the compiler creating a temporary copy. For local variables in subroutines (without the SAVE attribute) (for Fortran 95 and higher), allocatable arrays are automatically deallocated upon exit from the subroutine, avoiding a memory leak. Memory leaks aren't possible with allocatables, except in the sense of the programmer not deallocating an array that is no longer need. With pointers, you can reassign a pointer, leaving some memory inaccessible and lost -- one form of a leak. If an allocatable will do the job, I recommend using that method instead of a pointer. Some reasons to use pointers: taking a section of an array, or creating a data structure such as a linked list. For the purpose of creating an array of size determined at run time, I'd use an allocatable.
Tuesday, July 16, 2013
Password-less login
expect and automatic login
"expect" command is simply expecting a text from terminal, and send it when it meets expectation.
Sample usage.
Let's make simple shell program
Type into shell shell program.
"expect" command is simply expecting a text from terminal, and send it when it meets expectation.
sudo apt-get install expectInstallation is done.
Sample usage.
Let's make simple shell program
vi abc.sh
Type into shell shell program.
#!/usr/bin/expect -f set timeout 100 spawn ssh userid@servername expect "/home/devtrigger/.ssh/id_rsa" send "password\r" expect "servername:" send "bash\r" interact
http://devtrigger.blogspot.com/2012/02/install-expect-on-ubuntu-11.html
http://greg-n-blog.blogspot.com/search/label/ssh
http://stackoverflow.com/questions/12202587/ssh-script-that-automatically-enters-password
http://stackoverflow.com/questions/4780893/use-expect-in-bash-script-to-provide-password-to-ssh-command
Wednesday, May 8, 2013
Daily reading: /proc/net
Exploring the /proc/net Directory
http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
more can be found in linux man page:
http://linux.die.net/man/5/proc
http://www.onlamp.com/pub/a/linux/2000/11/16/LinuxAdmin.html
more can be found in linux man page:
http://linux.die.net/man/5/proc
Subscribe to:
Posts (Atom)