domingo, 7 de maio de 2017

Error compiling example kernel module from lkmpg.pdf

So you are now creating your first kernel module and still the "thing" does not want you to be the next kernel hacker ?

Here's some of the errors you will see:

+++++++++++++++
 make
uname: extra operand ‘−r’
Try 'uname --help' for more information.
uname: extra operand ‘−r’
Try 'uname --help' for more information.
make: Nothing to be done for `all'.


[Answer]:  Stop being lazy and don't just copy/past the code from the pdf, write your own code! That is: make sure that on the Makefile you have a "-" minus sign and NOT a a dash "−"

+++++++++++++++
make: Nothing to be done for `all'.

 [Answer]:  Stop being lazy by the second time, there is a "TAB" before "make -C /lib/modules/$(shell uname -r)/build M=$(shell pwd) modules" and not spaces, make is pick on this...

+++++++++++++++
make[2]: *** No rule to make target `/home/r/kernel_module/hello.c', needed by `/home/r/kernel_module/hello.o'.  Stop.
make[1]: *** [_module_/home/r/kernel_module] Error 2
-- Make sure file is under hello.c because your object will be hello.o-----

[Answer]: Now you want your own name.... so please make sure .o in Makefile match .c names you are coding, that is if your file is mynewkernelmodule.c make sure on Makefile you have  "mynewkernelmodule.o"

 +++++++++++++++

Have fun!



sexta-feira, 10 de setembro de 2010

vi hex mode

Sometimes your last resort is the "vi" editor.... hell some people coded an operating system just using "vi"....

When you need hex mode just...

:%!xxd

when you're done

:%!xxd -r

or just quit and save

:wq

or quit without saving

:q!

easy hum?

sexta-feira, 9 de abril de 2010

The loop mount - see contents of iso file

Imagine you downloaded an CD "iso" image and you want to see what's inside perhaps to add a few files.

As "root" (only root can do that or an user with privileges) issue the following command:

#
# mount -o loop /home/youruser/my-iso-file.iso /mnt/DISK/
#

That is: mount -options its_a_loop_device /the_path_to_the_file /the_mount_point

In this case the mount point is under "/mnt" directory (and "/DISK" directory was created) but could be any other location you specified.

quinta-feira, 8 de abril de 2010

Download files from Nokia E65 phone using bluetooth

True for other Nokia phones also.

# command line
#
#obexftp -i -b 00:17:E6:05:04:34 -g "C:/Data/Images/07042010(003).JPG"
#

Explanation:

obexftp -connect_using_irda_protcola -bluetooth_device device_number(00:17:E6:05:04:34) -retrive_files_from_mobile "path_to_and_file_nane"

Attention that the path for the file name depend on you mobile phone language.
To see the name of the image file go to "Gallery" "Images" on the phone menu.

For videos the path is: "C:/Data/Videos/" append the file name after Videos/ using MP4 as extension.

Used modules and needed software

ObexFTP version 0.22
Kernel: 2.6.18-1.2798.fc6
Modules:
rfcomm 46041 1
l2cap 31681 9 rfcomm
bluetooth 58917 4 rfcomm,l2cap

rfcomm -a (lists the mobile phone device id)

Bluetooth dongle was the cheapest I could find, the id is: ID 0e8f:0016 GreenAsia Inc.
bought at a Chinese store.

quarta-feira, 7 de abril de 2010

xeyes


"Those who don't understand UNIX are condemned to reinvent it, poorly." – Henry Spencer

Quite true! If you look at the major features in Unix systems you will see them implemented in the new versions of the most common operating systems in use today.

My computer background started around 82 (that is 1982) when I started using an ZX Spectrun computer. Them came some time without computers and after I started using PC's or shall we say IBM PC with the good oldie Intel 8088 CPU (not 8086). At that time DOS was the master OS then came Windows 3.0 and 3.1 for work groups. One day I was making a school work typing some text and the bloodie text processor crashed making me lost 22 pages of text. I tough that applications and OS should be more robust than this....that idea stayed in my mind! Some time later around 1996 I was attending a computer exhibition and spotted some nice little app, different in everything I had seen, graphically and interface wise... I saw "xeyes" running in a "xserver" with "twm" window manager on a Linux machine....I had found my future OS of choice! Since 1997 I am Micro!@##$$ free!!! That is 13 happy computing years!

In this blog I will document , mostly for my future reference, the Linux configurations and settings I use because it's a pain to configure everything again and again when you install a new distro.