2016年9月27日

使用 Ubuntu Server  难免会遇到需要gui的时候,
这里介绍一种最简单的方法

$sudo tasksel

这一句就可以了。
然后会有桌面列表可以选择,空格键选择,然后回车。
等待完成。

posted @ 2016-09-27 17:04 snowman1101 阅读(1497) | 评论 (0)编辑 收藏

2016年6月14日

今天拿到了 Microsoft Surface 3 ,
测试一个EFI程序的时候总是出问题,
后来查了一下,发现在使用EFI_BLOCK_IO 取得外接USB闪存大小的时候
也就是 BlkIo->Media->LastBlock 取得的大小会比实际的多出来一个
估计是写固件的人理解出了问题。
这里是定义
/**
  Block IO read only mode data and updated only via members of BlockIO
*
*/
typedef struct {
  ///
  
/// The curent media Id. If the media changes, this value is changed.
  
///
  UINT32  MediaId;         
   ///
  
/// TRUE if the media is removable; otherwise, FALSE.
  
///    
  BOOLEAN RemovableMedia;
   ///
  
/// TRUE if there is a media currently present in the device;
  
/// othersise, FALSE. THis field shows the media present status
  
/// as of the most recent ReadBlocks() or WriteBlocks() call.  
  
///
  BOOLEAN MediaPresent;
  ///
  
/// TRUE if LBA 0 is the first block of a partition; otherwise
  
/// FALSE. For media with only one partition this would be TRUE.
  
///
  BOOLEAN LogicalPartition;
   ///
  
/// TRUE if the media is marked read-only otherwise, FALSE.
  
/// This field shows the read-only status as of the most recent WriteBlocks () call.
  
///
  BOOLEAN ReadOnly;
   ///
  
/// TRUE if the WriteBlock () function caches write data.
  
///
  BOOLEAN WriteCaching; 
   ///
  
/// The intrinsic block size of the device. If the media changes, then
  
/// this field is updated.  
  
///
  UINT32  BlockSize; 
   ///
  
/// Supplies the alignment requirement for any buffer to read or write block(s).
  
///
  UINT32  IoAlign; 
   ///
  
/// The last logical block address on the device.
  
/// If the media changes, then this field is updated. 
  
///
  EFI_LBA LastBlock; 
  ///
  
/// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
  
/// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the first LBA is aligned to 
  
/// a physical block boundary. 
  
///
  EFI_LBA LowestAlignedLba;
  ///
  
/// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
  
/// EFI_BLOCK_IO_PROTOCOL_REVISION2. Returns the number of logical blocks 
  
/// per physical block.
  
///
  UINT32 LogicalBlocksPerPhysicalBlock;
  ///
  
/// Only present if EFI_BLOCK_IO_PROTOCOL.Revision is greater than or equal to
  
/// EFI_BLOCK_IO_PROTOCOL_REVISION3. Returns the optimal transfer length
  
/// granularity as a number of logical blocks.
  
///
  UINT32 OptimalTransferLengthGranularity;
} EFI_BLOCK_IO_MEDIA;
其中那个LastBlock是这样说明的
  /// The last logical block address on the device.
所以应该是总的block 数-1.
不知道微软的工程师为什么会有这样的错误

posted @ 2016-06-14 09:28 snowman1101 阅读(448) | 评论 (0)编辑 收藏

2013年3月28日

前言 
 编译好 EFI程序后,每次都用U盘到另外一台电脑上测试实在很麻烦,一天下来U盘要插拔很多次
无意中发现
Oracle VM VirtualBox 的系统选项中有个 支持 EFi 。
又在网上找了一下发现 VMware Player 也可以支持 EFI
下面总结一下方法

1. 首先到VMWARE官网下载免费的 VMware Player 下载
2.正常安装VM Player后 创建一个新的虚拟主机,并且类型选择 64位的OS
3.到创建的虚拟机目录 找到 .
vmx文件 用记事本打开 然后添加一行 
firmware = "efi" 
这样你的VM虚拟机就支持UEFI启动了。


如果想要测试我们自己编译的 .EFI 程序的话
到虚拟主机的编辑选项中,新添加一个硬盘,然后类型选择实际物理磁盘
根据个人的需要再选择整个磁盘或者某一个分区
之后把编译好的EFI文件复制到指定的磁盘或者分区中就可以了。
要注意的是,开启虚拟机的时候必须保证指定的磁盘/分区是关闭的。同样复制文件的时候也要关闭虚拟机。






posted @ 2013-03-28 11:12 snowman1101 阅读(570) | 评论 (0)编辑 收藏

仅列出标题