Haili's profileHaili的共享空间BlogGuestbookNetwork Tools Help

Haili的共享空间

This person's network is empty (or maybe they're keeping it private).

ubuntu 8.04 live cd/usb persistent

live + persistent是个不错的组合

704好像没有问题;

710有问题,好像是脚本里忘记处理persistent参数;

804仍然有问题,得到initramfs的shell。

检查casper.log,问题在mount persistent文件系统时发生,invalid argument。查script/casper,去掉mount的参数mode=755。通过。我的persistent分区是ext3,label是casper-rw。(从脚本中可知,还可以在vfat分区上建立casper-rw文件,loop)

 

操作initrd的命令:

gunzip initrd.gz

cpio -id < initrd

find  * | cpio -H newc -o > ../initrd

gzip -9 initrd

计算代码运行的时间

这里(http://www.newsmth.net/bbstcon.php?board=CPlusPlus&gid=212073)讨论了浮点数与字符串转换的问题,示例代码有计算代码运行的时间,两种方法:

  • win32, vc2005

__declspec(naked) __int64 CPUCycleCounter()
{
    __asm
    {
        RDTSC;
        ret;
    }
}

相应代码在Linux下(测试通过):

static inline __int64_t CPUCycleCounter()
{
        __asm__ ("RDTSC");
        return;
}

 

  • Linux

uint64_t CPUCycleCounter(){
        struct timeval tv;
        gettimeofday(&tv,NULL);
        uint64_t v=(uint64_t)tv.tv_sec*1000000+tv.tv_usec;
        return v;
}

 

Haili

感谢访问!
Please wait...
Sorry, the comment you entered is too long. Please shorten it.
You didn't enter anything. Please try again.
Sorry, we can't add your comment right now. Please try again later.
To add a comment, you need permission from your parent. Ask for permission
Your parent has turned off comments.
Sorry, we can't delete your comment right now. Please try again later.
You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
Complete the security check below to finish leaving your comment.
The characters you type in the security check must match the characters in the picture or audio.