ramdisk

Does OS X have an equivalent to /dev/shm?

走远了吗. 提交于 2019-12-02 14:38:25
Does OS X (Snow Leopard in particular) have an equivalent to (some versions of) Linux's /dev/shm , ie something where you can write to and read from a file without necessarily touching the hard drive? You can create and mount a ram based disk as follows: Create a disk $ hdiutil attach -nomount ram://$((2 * 1024 * SIZE_IN_MB)) hdiutil will return the name of the ramdisk. Format and mount the disk diskutil eraseVolume HFS+ RAMDisk NAME_OF_DISK Creating a 100MB ramdisk: $ hdiutil attach -nomount ram://$((2 * 1024 * 100)) /dev/disk3 $ diskutil eraseVolume HFS+ RAMDisk /dev/disk3 Started erase on

Sharing large datasets between Matlab and R

喜你入骨 提交于 2019-11-30 12:44:28
问题 I need a relatively efficient way to share data between Matlab and R. I have checked SaveR and MATLAB R-link, but SaveR formats Matlab's binary data as text strings first and then prints them to an ASCII file, which is not efficient for large datasets, and MATLAB R-link only works on Windows (it uses a COM-based interface). Update: Dirk has posted a list of what seem to be better solutions to this problem than SaveR and Matlab R-link . I also learned recently about RAM disks (see here and

Sharing large datasets between Matlab and R

梦想的初衷 提交于 2019-11-30 03:35:54
I need a relatively efficient way to share data between Matlab and R . I have checked SaveR and MATLAB R-link , but SaveR formats Matlab's binary data as text strings first and then prints them to an ASCII file, which is not efficient for large datasets, and MATLAB R-link only works on Windows (it uses a COM-based interface). Update: Dirk has posted a list of what seem to be better solutions to this problem than SaveR and Matlab R-link . I also learned recently about RAM disks (see here and here for some implementation examples), and thought that they might facilitate the task of sharing large

In-Memory File System for WIndows

大憨熊 提交于 2019-11-29 21:57:30
问题 I have a command-line executable which I need to run from Java on Windows XP. It uses files as input and output. But I want to avoid the overhead of file IO, so I thought of an in-memory RAM file system. NetBSD has mount_mfs. Could you recommend the most convenient way of doing this? 回答1: You should also consider whether you really need this (premature optimization, yadda, yadda). On all modern operating systems, filesystem I/O is cached anyway, so frequently-used files are essentially as

Linux 下的dd命令使用详解以及dd if=/dev/zero of=的含义

冷暖自知 提交于 2019-11-29 10:08:52
一、dd命令的解释 dd:用指定大小的块拷贝一个文件,并在拷贝的同时进行指定的转换。 注意:指定数字的地方若以下列字符结尾,则乘以相应的数字:b=512;c=1;k=1024;w=2 参数注释: 1. if=文件名:输入文件名,缺省为标准输入。即指定源文件。< if=input file > 2. of=文件名:输出文件名,缺省为标准输出。即指定目的文件。< of=output file > 3. ibs=bytes:一次读入bytes个字节,即指定一个块大小为bytes个字节。 obs=bytes:一次输出bytes个字节,即指定一个块大小为bytes个字节。 bs=bytes:同时设置读入/输出的块大小为bytes个字节。 4. cbs=bytes:一次转换bytes个字节,即指定转换缓冲区大小。 5. skip=blocks:从输入文件开头跳过blocks个块后再开始复制。 6. seek=blocks:从输出文件开头跳过blocks个块后再开始复制。 注意:通常只用当输出文件是磁盘或磁带时才有效,即备份到磁盘或磁带时才有效。 7. count=blocks:仅拷贝blocks个块,块大小等于ibs指定的字节数。 8. conv=conversion:用指定的参数转换文件。 ascii:转换ebcdic为ascii ebcdic:转换ascii为ebcdic ibm

CentOS启动流程

点点圈 提交于 2019-11-28 23:56:03
CentOS启动流程 Step 1: POST 加电自检 此过程的就是为了检测一下外界的硬件设备是否能够正常运行,如CPU,内存设备,硬盘等等这些硬件设备是否可以正常工作。 完成这一任务的是在主板上的BIOS程序 Step 2: Boot Sequence 主要实现的功能是 选择要启动的硬件设备 ,选择了之后就可以读取这个设备上位于MBR里头的bootloader了。根据BIOS中对启动顺序的设定,BIOS自己会依次扫描各个引导设备,然后第一个被扫描到具有引导程序(bootloader)的设备就被作为要启动的引导设备。 Step3: Bootloader MBR分为三个部分 MBR(Master Boot Record) MBR记录一般是在磁盘 0 磁道 1 扇区,共512个字节。前446个字节是BootLoder,后 4*16 的 64 个字节是存放分区信息的,最后 2 个字节是校验信息,一般是 55AA MBR中的bootloader,bootloader提供一个菜单给用户,让用户去选择要启动的系统或不同的内核版本,然后把用户选择的内核版本加载至RAM中的特定空间,接着在RAM中解压、展开,而后把系统控制权移交给内核。 CentOS使用GRUB(grand uniform bootloader)引导, CentOS 7 使用 GRUB2,此前版本使用GRUB.

How can I create a ramdisk in Python?

喜夏-厌秋 提交于 2019-11-28 07:12:22
I want to create a ramdisk in Python. I want to be able to do this in a cross-platform way, so it'll work on Windows XP-to-7, Mac, and Linux. I want to be able to read/write to the ramdisk like it's a normal drive, preferably with a drive letter/path. The reason I want this is to write tests for a script that creates a directory with a certain structure. I want to create the directory completely in the ramdisk so I'll be sure it would be completely deleted after the tests are over. I considered using Python's tempfile , but if the test will be stopped in the middle the directory might not be

CentOS 启动流程

冷暖自知 提交于 2019-11-28 05:06:33
CentOS 启动流程 linux组成:kernel+rootfs kernel的功能:进程管理,内存管理、网络管理、文件系统、驱动程序、安全管理 rootfs: glibc(库):函数(function)的集合,提供调用接口。 过程调用:procedure 函数调用:function 程序: 二进制程序文件(用户程序) 内核设计的流派: 单内核设计:Linux 把所有功能集成一个程序,所有子系统使用线程实现 微内核设计:Windows, Solaris 每个子系统独立运作,在一个核心框架下协同工作 Linux内核特点: 支持模块化:*.ko(文件) 支持模块的动态装卸载 组成部分: 核心文件:/boot/vmlinuz-VERSIOM-release ramdisk:/boot/initramfs-VERSIOM-release.img 模块文件:/lib/modules/VERSIOM-release/ CentOS6系统启动流程 POST:加点自检(CMOS,BIOS) Boot Sequence(BIOS设置的启动顺序):按照设置次序逐个进行寻找,直到找到第一个有引导程序的设备,进行引导。 bootloader:引导加载器 Windwos:ntloader Linux: LILO: LInux LOader(Android常用) GRUB:GRand Uniform

CentOS启动流程

拈花ヽ惹草 提交于 2019-11-28 05:06:08
CentOS启动流程 Step 1: POST 加电自检 此过程的就是为了检测一下外界的硬件设备是否能够正常运行,如CPU,内存设备,硬盘等等这些硬件设备是否可以正常工作。 完成这一任务的是在主板上的BIOS程序 Step 2: Boot Sequence 主要实现的功能是 选择要启动的硬件设备 ,选择了之后就可以读取这个设备上位于MBR里头的bootloader了。根据BIOS中对启动顺序的设定,BIOS自己会依次扫描各个引导设备,然后第一个被扫描到具有引导程序(bootloader)的设备就被作为要启动的引导设备。 Step3: Bootloader MBR分为三个部分 MBR(Master Boot Record) MBR记录一般是在磁盘 0 磁道 1 扇区,共512个字节。前446个字节是BootLoder,后 4*16 的 64 个字节是存放分区信息的,最后 2 个字节是校验信息,一般是 55AA MBR中的bootloader,bootloader提供一个菜单给用户,让用户去选择要启动的系统或不同的内核版本,然后把用户选择的内核版本加载至RAM中的特定空间,接着在RAM中解压、展开,而后把系统控制权移交给内核。 CentOS使用GRUB(grand uniform bootloader)引导, CentOS 7 使用 GRUB2,此前版本使用GRUB.

ArmLinux BOOTLOADER全程详解

橙三吉。 提交于 2019-11-28 03:09:25
网上关于Linux的BOOTLOADER文章不少了,但是大都是vivi,blob等比较庞大的程序,读起来不太方便,编译出的文件也比较大,而且更多的是面向开发用的引导代码,做成产品时还要裁减,这一定程度影响了开发速度,对初学者学习开销也比较大,在此分析一种简单的BOOTLOADER,是在三星公司提供的2410 BOOTLOADER上稍微修改后的结果,编译出来的文件大小不超过4k,希望对大家有所帮助. 1.几个重要的概念 COMPRESSED KERNEL and DECOMPRESSED KERNEL 压缩后的KERNEL,按照文档资料,现在不提倡使用DECOMPRESSED KERNEL,而要使用COMPRESSED KERNEL,它包括了解压器.因此要在ram分配时给压缩和解压的KERNEL提供足够空间,这样它们不会相互覆盖.当执行指令跳转到 COMPRESSED KERNEL后,解压器就开始工作,如果解压器探测到解压的代码会覆盖掉COMPRESSED KERNEL,那它会直接跳到COMPRESSED KERNEL后存放数据,并且重新定位KERNEL,所以如果没有足够空间,就会出错. Jffs2 File System 可以使armlinux应用中产生的数据保存在FLASH上,我的板子还没用到这个. RAMDISK 使用RAMDISK可以使ROOT FILE