-
2008-07-17
在xubuntu上安装psptoolchain - [软件]
1.下载psptoolchain
wget http://ps2dev.org/psp/Tools/Toolchain/psptoolchain-20070626.tar.bz2
将其保存/opt目录并解包
2.安装相关的软件包
sudo apt-get install build-essential autoconf automake bison flex libncurses5-dev libreadline-dev libusb-dev texinfo
3.设置环境变量
sudo mousepad ~/.bashrc
在最后加上
export PSPDEV=/usr/local/pspdev
export PATH=$PATH:$PSPDEV/bin
4.重新加载
source ~/.bashrc
5.编译并安装psptoolcain和pspsdk
cd /opt/psptoolchain
sudo ./toolchain-sudo.sh
6.改变/usr/local/pspdev文件夹属性,加入使用的用户及组
7.检查编译器版本
psp-gcc -v
成功后会有如下输出
Using built-in specs. Target: psp Configured with: ../configure --prefix=/usr/local/pspdev --target=psp --enable-languages=c,c++ --with-newlib --enable-cxx-flags=-G0 Thread model: single gcc version 4.1.0 (PSPDEV 20060507)
8.编译测试
cd /usr/local/pspdev/psp/sdk/samples/savedata/decrypt
make
成功后会生成一个EBOOT.PBP文件。 -
2008-07-05
xubuntu中wine中文显示 - [软件]
代码: mousepad ~/.wine/system.re
搜索: LogPixels
找到的行应该是:[System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts]
将其中的:
“LogPixels”=dword:00000060
改为:
“LogPixels”=dword:00000070
搜索: FontSubstitutes
找到的行应该是:[Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes]
将其中的:
“MS Shell Dlg”=”Tahoma”
“MS Shell Dlg 2″=”Tahoma”
改为:
“MS Shell Dlg”=”SimSun”
“MS Shell Dlg 2″=”SimSun”拷贝simsun.ttc文件到wine中的windows/fonts下面。
-
2008-06-29
USB Xubuntu 8.04 Persistent install from Linux - [软件]
出差背两个电脑是比较辛苦的事,但是公私需要分开,使用工作的电脑处理一些私人的事情,是比较麻烦的。这种安装在USB上的live Linux可以方便的处理。
PS:还没有试验过,试过之后再写个report.This tutorial covers the process of installing Xubuntu 8.04 to a USB flash drive from within a running (Ubuntu) Linux environment. Xubuntu uses the xfce desktop environment as opposed to Gnome or KDE. Xfce helps Xubuntu run smoother and quicker on older and slower PC's. In addition, this installation tutorial utilizes the casper persistence feature to enable changes to be saved and restored on subsequent boots. If you have access to a working Ubuntu Linux installation and your system does not have a CD drive, this tutorial is for you.
Basic essentials for Xubuntu 8.04 USB installation:
- Working Linux environment (we used a local Ubuntu installation)
- Established internet connection
- 1GB or larger USB flash drive
How to install Xubuntu 8.04 to a flash drive from Linux:
- Insert a 1GB or larger USB flash drive (2GB+ recommended)
- Open a terminal and type sudo su
- As one line, type wget cdimage.ubuntu.com/xubuntu/releases/hardy/release/xubuntu-8.04-desktop-i386.iso
- Type mount -o loop -tiso9660 xubuntu*.iso /cdrom
- Type fdisk -l to list available drives/partitions (note which device is your flash drive I.E. /dev/sdb). Throughout this tutorial, replace all instances of x with your flash drive letter. For example, if your flash drive is sdb, replace x with b.
- Type umount /dev/sdx1
- Type fdisk /dev/sdx
- type p to show the existing partition and d to delete it
- type p again to show any remaining partitions (if partitions exist, repeat the previous step)
- type n to make a new partition
- type p for primary partition
- type 1 to make this the first partition
- hit enter to use the default 1st cylinder
- type +750M to set the partition size
- type a to make this partition active
- type 1 to select partition 1
- type t to change the partition filesystem
- type 6 to select the fat16 file system
- type n to make another new partition
- type p for primary partition
- type 2 to make this the second partition
- hit enter to use the default cylinder
- hit enter again to use the default last cylinder
- type w to write the new partition table
- Type umount /dev/sdx1 to unmount the partition
- Type mkfs.vfat -F 16 -n xubuntu8 /dev/sdx1 to format the first partition
- Type umount /dev/sdx2 to ensure the partition is unmounted
- Type mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2 to format the second partition
- Remove and re-insert your flash drive (if prompted that a new medium has been detected, select to open in a new window and click ok)
- Back at the terminal, type sudo apt-get install syslinux mtools
- Type syslinux -sf /dev/sdx1
- Type cd /cdrom
- Type cp -rfv casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines install/mt86plus /media/xubuntu8
- Type cd /media/xubuntu8
- Type wget pendrivelinux.com/downloads/xu8/syslinux.cfg
- Type cd casper
- Type rm initrd.gz
- Type wget pendrivelinux.com/downloads/xu8/initrd.gz
- Reboot your computer and set your system BIOS or Boot Menu to boot from the USB stick. Save your changes and proceed to boot from the USB device
You should now be booting Xubuntu 8.04 from the memory stick and by default it should save your changes, restoring them on subsequent boots.
Notes: If your having trouble getting Ubuntu to boot, your memory stick may have a corrupted MBR. To repair the MBR of your USB device, at the terminal type sudo apt-get install lilo then type lilo -M /dev/sdx (replacing x with the letter of your flash device)
- Working Linux environment (we used a local Ubuntu installation)
-
2008-03-20
Ubuntu的load/unload cycles损伤硬盘的问题 - [软件]
今天很累也很困了,但是在浏览文章中发现了Ubuntu如果设置不好,会损坏甚至毁坏笔记本硬盘的问题,于是决定将这篇文章看完并写下这篇文章。这里就是看到的第一篇文章<Ubuntu电源管理问题的说明和解决方案>,看完之后对这个所谓的Load/unload Cycle还不是很了解,于是就做了一些调查,并且发现这个问题已经发给官方了,具体BUG Report可以在这里看到(https://bugs.launchpad.net/ubuntu/+bug/104535)。请看上图,所谓的load/unload cycle就是slider与硬盘盘片接触的周期,每一个硬盘出厂前都会有这么一个参数是固定的,也就是当硬盘快接近这个出厂参数时,就意味着这块硬盘已经接近报销的边缘。在西部数据官方上找到我的硬盘的相关参数信息,里面就有一个是Load/unload cycles at ambient condition 600,00(DATA Sheet),也就是说,我的硬盘的寿命取决于现有使用的这个参数值与官方值是否接近,具体查看及设置方法如下:- 安装smartmontools,因为需要名为smartctl的来检查相关的信息
sudo apt-get install smartmontools - 启用硬盘SMART监控功能
sudo smartctl -s on /dev/sda
brucebot@brucebot-laptop:/etc/laptop-mode$ sudo smartctl -s on /dev/sda
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.
注:/dev/sda请选择你的硬盘,如果是IDE的,则是/dev/hda - 查看当前硬盘的详细状态
sudo smartctl -d ata -A /dev/sda
brucebot@brucebot-laptop:/etc/laptop-mode$ sudo smartctl -d ata -A /dev/sda
smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/
=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 199 197 051 Pre-fail Always - 426
3 Spin_Up_Time 0x0003 185 180 021 Pre-fail Always - 1733
4 Start_Stop_Count 0x0032 100 100 000 Old_age Always - 450
5 Reallocated_Sector_Ct 0x0033 200 200 140 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 200 200 051 Pre-fail Always - 0
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 480
10 Spin_Retry_Count 0x0013 095 095 051 Pre-fail Always - 23
11 Calibration_Retry_Count 0x0012 100 100 051 Old_age Always - 0
12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 263
192 Power-Off_Retract_Count 0x0032 200 200 000 Old_age Always - 153
193 Load_Cycle_Count 0x0032 195 195 000 Old_age Always - 15977
194 Temperature_Celsius 0x0022 108 099 000 Old_age Always - 39
196 Reallocated_Event_Count 0x0032 200 200 000 Old_age Always - 0
197 Current_Pending_Sector 0x0012 200 200 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 253 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 200 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0009 100 253 051 Pre-fail Offline - 0
请看,红色的即为我的硬盘的load/unload cycles看起来,已经有了四分之一多了,也就是说这块硬盘的四分之一寿命已经没有了。
当然,如果仅仅想知道这个参数,可以使用sudo smartctl -a /dev/sda | grep Load_Cycle_Count仅仅导出这个参数。如果你安装了Ubuntu,并且没有经过相应的设置,再次执行上面的命令后,load_Cycle_count的数值会不断增大。 Ubuntu默认不会改动内置的参数,笔记本硬盘内置的自动进入低耗状态的参数过于严厉,导致频繁的Load/Unload,其他系统则无视或者不使用硬盘的这一功能,反而保护了硬盘的寿命。也就是说,只有Ubuntu存在这个问题。 - 解决方法
- 关闭高级电源管理模块(Advanced Power Management setting)
Sudo hdparm -B 255 /dev/sda
brucebot@brucebot-laptop:/etc/laptop-mode$ sudo hdparm -B 255 /dev/sda
/dev/sda:
setting Advanced Power Management level to disabled - 使用laptop-mode-tools
- Sudo apt-get install laptop-mode-tools
- 查看Laptop-mode是否启动
grep ENABLE_LAPTOP_MODE /etc/default/acpi-supportbrucebot@brucebot-laptop:/etc/laptop-mode$ grep ENABLE_LAPTOP_MODE /etc/default/acpi-support
ENABLE_LAPTOP_MODE=false 启动laptop-mode
sudo cp /etc/default/acpi-support /etc/default/acpi-support_backup
sudo gedit /etc/default/acpi
找到ENABLE_LAPTOP_MODE=false,并且将其设置成true
注:我是同时设置了两种方法,使用命令sudo smartctl -d ata -A /dev/sda多次后可以看到,Load_cycle_count的值没有再增长。至此,问题解决!
- 关闭高级电源管理模块(Advanced Power Management setting)
- 安装smartmontools,因为需要名为smartctl的来检查相关的信息
-
2008-03-13
super Pi for Ubuntu - [软件]
Super PI 是一个计算圆周率的软件,在 Windows 平台上,经常使用 Super PI 来测试 CPU 超频是否稳定,可以说,Super PI 测试是否通过已经作为判断 CPU 稳定性的依据。suxixb(http://www.shareitem.org/2007/11/29/software-super-pi/)的一篇在UBUNTU下使用Super PI让我等使用ubuntu之辈也可以享受Super PI带来的好处了了。
说明:最后的 20 代表 1M(100万位),21 代表 2M,25 代表 32M。
使用方法,请至网页http://www.shareitem.org/2007/11/29/software-super-pi/下载super PI for ubuntu,解压后放在任意文件夹,使用终端进入文件夹,执行命令
sh super_pi,就可以执行SUPERPI了
下面是我的机器运行 sh super_pi选择 20 的结果
sh super_pi
Version 2.0 of the super_pi for Linux OS
Fortran source program was translated into C program with version 19981204 of
f2c, then generated C source program was optimized manually.
pgcc 3.2-3 with compile option of "-fast -tp px -Mbuiltin -Minline=size:1000 -Mnoframe -Mnobounds -Mcache_align -Mdalign -Mnoreentrant" was used for the
compilation.
------ Started super_pi run : Wed Mar 12 00:16:45 CST 2008
Parameter(%i) to super_pi is missing. Parameter value ? 20
Start of PI calculation up to 1048576 decimal digits
End of initialization. Time= 0.484 Sec.
I= 1 L= 0 Time= 1.420 Sec.
I= 2 L= 0 Time= 1.576 Sec.
I= 3 L= 1 Time= 1.640 Sec.
I= 4 L= 2 Time= 1.664 Sec.
I= 5 L= 5 Time= 1.608 Sec.
I= 6 L= 10 Time= 1.608 Sec.
I= 7 L= 21 Time= 1.584 Sec.
I= 8 L= 43 Time= 1.584 Sec.
I= 9 L= 87 Time= 1.640 Sec.
I=10 L= 174 Time= 1.600 Sec.
I=11 L= 349 Time= 1.584 Sec.
I=12 L= 698 Time= 1.560 Sec.
I=13 L= 1396 Time= 1.580 Sec.
I=14 L= 2794 Time= 1.580 Sec.
I=15 L= 5588 Time= 1.568 Sec.
I=16 L= 11176 Time= 1.580 Sec.
I=17 L= 22353 Time= 1.568 Sec.
I=18 L= 44707 Time= 1.540 Sec.
I=19 L= 89415 Time= 1.408 Sec.
End of main loop
End of calculation. Time= 31.706 Sec.
End of data output. Time= 0.168 Sec.
Total calculation(I/O) time= 31.874( 1.044) Sec.
------ Ended super_pi run : Wed Mar 12 00:17:35 CST 2008
32秒不到,看来还是不错的。
-
2008-03-12
virtualbox USB支持 - [软件]
最近需要在XP下安装一些软件并作相应的测试,但是我的机子只安装了一个系统,所以使用virtuaBox安装了一个winxp的虚拟机,但是在实际使用过程中,使用USB却碰到了麻烦,启动时virtualbox会有usbfs的权限报错,修改权限后问题解决。
- VirtualBox安装
http://195.34.175.98/download/1.5.6/virtualbox_1.5.6-28266_Ubuntu_gutsy_i386.deb
使用上述地址下载最新版的virtualbox,这个是for gutsy(ubuntu7.10)的,如使用其他的linux系统,请至http://www.virtualbox.org/wiki/Downloads选择相应的版本,下载完毕后双击后输入ROOT密码就可以完成安装。
当然,如果你喜欢使用apt-get 来安装软件,可以参考http://www.virtualbox.org/wiki/Downloads上面关于使用源来安装软件的方法。 - 设置USB使用权限
需要设置两个文件的内容1) sudo gedit /etc/udev/rules.d/40-permissions.rules(你也可以使用VIM等其他文本编辑器),找到如下语句# USB devices (usbfs replacement)
#SUBSYSTEM=="usb_device", MODE="0664"
改成
# USB devices (usbfs replacement)
SUBSYSTEM=="usb_device", MODE="0666"
2)sudo gedit /etc/init.d/mountdevsubfs.sh,找到如下语句
# Magic to make /proc/bus/usb work
#
#mkdir -p /dev/bus/usb/.usbfs
#domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
#ln -s .usbfs/devices /dev/bus/usb/devices
#mount --rbind /dev/bus/usb /proc/bus/usb
取消前面的#引用标识,更改后如下
# Magic to make /proc/bus/usb work
#
mkdir -p /dev/bus/usb/.usbfs
domount usbfs "" /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644
ln -s .usbfs/devices /dev/bus/usb/devices
mount --rbind /dev/bus/usb /proc/bus/usb
- VirtualBox安装
-
在安装新的OSS驱动之前,如果系统中还有残留的驱动文件存在,安装过程是不能够完成的,因此首先要做的就是查看一下,系统内是否有以前的驱动存在。方法如下:
1 在终端下进入目录/var/lib/dpkg/info,命令 cd /var/lib/dpkg/info
2 删除所有以oss-linux开头的文件,命令sudo rm oss-linux*
3 编辑文件/var/lib/dpkg/status,sudo gedit /var/lib/dpkg/status,找到关于oss-linux的有关内容,并将其删除(内容如下)Package: oss-linux
Status: install ok installed
Priority: extra
Section: alien
Installed-Size: 8440
Maintainer: root <root@dev-desktop>
Architecture: amd64
Version: v4.0rc9-999
Depends: libatk1.0-0 (>= 1.12.1), libc6 (>= 2.4-1), libcairo2 (>= 1.2.4), libfontconfig1 (>= 2.3.0), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.10.3), libpango1.0-0 (>= 1.14.5), libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxfixes3, libxi6, libxinerama1, libxrandr2, libxrender1
Conffiles:
/etc/oss.conf 055432d38aaf37fc6de3dba4a95accc3
Description: Open Sound System sound drivers for Linux
Open Sound System for Linux (OSS/Linux) is a commercial quality sound driver
distributed by 4Front Technologies (http://www.opensound.com). OSS provides
support for practically all sound cards on the market including PnP and
many PCI ones. Installation and configuration is higly automated and easy to
perform. To obtain technical support and additional features, you will need to
order a license key from http://www.opensound.com/order.html
(Converted from a rpm package by alien version 8.64.)4 查看oss-linux当前状态,命令 sudo dpkg --purge oss-linux,则会显示如下信息
dpkg - warning: ignoring request to remove oss-linux which isn't installed.
5 安装oss-linux,命令 sudo dpkg -i oss-linux_v4.0-1013_i386.deb,安装显示信息如下
brucebot@brucebot-laptop:~/MyDownloads$ sudo dpkg -i oss-linux_v4.0-1013_i386.deb
Selecting previously deselected package oss-linux.
(Reading database ... 132118 files and directories currently installed.)
Unpacking oss-linux (from oss-linux_v4.0-1013_i386.deb) ...
Setting up oss-linux (v4.0-1013) ...
Building OSS Modules for Linux-unknown 2.6.22-14-generic
OSS build environment set up for REGPARM kernels
Building module osscore
Building module ali5455
Building module allegro
Building module als300
Building module als4000
Building module apci97
Building module atiaudio
Building module audigyls
Building module audioloop
Building module audiopci
Building module cmi8788
Building module cmpci
Building module cs4280
Building module cs4281
Building module digi32
Building module digi96
Building module emu10k1x
Building module envy24
Building module envy24ht
Building module fm801
Building module geode
Building module hdaudio
Building module hdsp
Building module ich
Building module imux
Building module lynxone
Building module lynxtwo
Building module maestro
Building module neomagic
Building module ossusb
Building module riptide
Building module s3vibes
Building module sblive
Building module sbxfi
Building module softoss
Building module solo
Building module sonorus
Building module trident
Building module via8233
Building module via97
Building module vmix
Building module vortex
Building module ymf7xx
depmod -a
-----------------------------
Detected Intel High Definition Audio (ICH8)
Detected Generic USB audio device (BETA)
Detected OSS Transparent Virtual Mixing Architecture
-----------------------------
Starting Open Sound System -
2008-02-27
To do list for utilize ubuntu on F31A - [软件]
Lenovo F31A has used many technology from thinkpad, such as Active Protection system for the hard disk(HDAPS).What is APS system? Here we go.
The Active Protection System
With the new series of ThinkPads IBM introduced the Active Protection System (APS) in 2003. The APS is a protection system for the ThinkPad's internal harddrive. A sensor inside the ThinkPad recognizes when the notebook is accelerated. A software applet then is triggered to park the harddisk. This way the risk of data loss in case of when the notebook is dropped is significantly reduced since the read/write head of the harddrive is parked and hence can't crash onto the platter when the notebook drops onto the floor.
The hardware sensor is capable of not only recognizing acceleration of the notebook, but also (to a certain degree) of its whole orientation in space, relative to gravity's axis. Furthermore, having the actual control put into software, its functionality is extendable and it gives chance to implement features like the "ignore minor shocks" feature which is present in the Windows based control applet. (This feature prevents the harddrive from parking in case of minor regular shocks such as occur when in a train or car.)
And the following websites are recorded for the future configuration for my notebook.1.http://www.thinkwiki.org/wiki/Active_Protection_System
2.http://article.gmane.org/gmane.linux.drivers.hdaps.devel/1040
3.http://www.thinkwiki.org/wiki/How_to_protect_the_harddisk_through_APS
-
2008-02-04
Ubuntu文件管理器Nautlius中键盘无法输入的问题 - [软件]
在使用的Nautilus文件管理器的时候,经常会无法输入文字,以下为解决方法,此解决方法在Ubuntu 7.10及SCIM输入法下测试通过。
1.取消SCIM的自动启动: 进入终端输入 im-switch -s none,注销后重新登录。
2. 进入终端输入 sudo gedit ~/.scim/config, 找到并设置/FrontEnd/X11/Dynamic=true.
3. 恢复SCIM的自动启动: 进入终端输入 im-switch -s scim,注销后重新登录 -
2008-02-01
Install Ubuntu 7.10 on My Lenovo F31A - [软件]
Table of Contents
1.Introduction
2.Summary
3.Computer details
1.Introduction
I purchased a Lenovo F31A laptop days ago, it is a great laptop except the pre-installed OS VISTA, I really do not like it. As I have some experence to use ubuntu on the PC, so I decide to install the Ubuntu 7.10 to the laptop. And the installation is very easy,just download the iso file from ubutnu homepage and burn it to a CD-ROM, then use this CD to boot laptop, follow the normal way to install ubuntu. It can easily automaitcally detect almost all the hardware and install the driver to them, except two hardware, the wireless card driver and the sound driver.
WIRELESS
1.Download a software named bcm43xx-fwcutter_20060108-6build1_i386.deb and install it.Here http://linuxwireless.org/en/users/Drivers/b43 you will find more details about b43.
2.Click the icon on the right above panel---Restricted Drivers, and enable the firmware for broadcom 43xx chipset family, then it will pop-up a window ask you to slect the firmware to download, pls choose the second one which is http://xeve.de/down/wl_apsta.o ,after finishing the download,ubuntu will automatically install the firmware.SOUND
I have tested all the alsa driver version, and some patches, which still have no effect to drive my sound card. Finally I found this article http://ubuntuforums.org/showpost.php?p=3768914&postcount=60 which help me to solve my sound card issue, so now I can listen music and watch movies under my new laptop now.
2.Summary
Hardware component
Status under Ubuntu 7.10
Notes
Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz
Works
13.3¨WXGA TFT(1280X800)
Works
nVidia GeForce 8400M GS(128MB)
Works
1GB RAM
Works
160GB HDD(WDC WD1600BEVS-2)
Works
DVD±RW(DVD RW AD-7640A)
Works
NetLink BCM5906M Fast Ethernet PCI Express
Works
BCM94311MCG wlan mini-PCI
Works
82801H (ICH8 Family) HD Audio Controller
Works
OSS
Memory Card Reader
Not test
Internal 56K modem
Not test
Lenovo EasyCamera
Not test
Bluetooth
Works
3.Computer Details
Pls see the details attached pdf file.
Download Install Ubuntu 7.10 on My Lenovo F31A Howto






