Haili 的个人资料Haili的共享空间日志留言簿网络 工具 帮助

日志


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;
}

12月27日

昨天晚上装MSN,发现Live家族的几个工具没有用过,突然有了想试试的想法。Live Mail好说,很快完成配置。再就是这个Live Writer了。