I am doing kernel development in mac, my kernel is loaded up by grub because it relay on multiboot spec. I was unable to install grub in a loopback device on mac, so my mac is running a small linux vm in virtual box, i write a simple php to let me upload my kernel, pack the grub and file system, then download it back to mac from vm. It is very stupid.
My hard disk is out of space, so i have to fix this grub bug. The root cause is : the following if-loop (grub-core/osdep/unix/hostdisk.c) are never be true in apple
#if GRUB_DISK_DEVS_ARE_CHAR if (S_ISCHR (st.st_mode)) #else if (S_ISBLK (st.st_mode)) #endif ret = grub_util_get_fd_size_os (fd, name, log_secsize)
hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount hd.img
read count : 102