2015年12月18日 星期五

WIMBoot overview 概論

English
========================================================================
Introduction
Windows image file boot (WIMBoot) lets you set up a PC so that it runs directly from a compressed Windows image file (WIM file).

Benefits
1.     Reduce the amount of space used by Windows.
2.     Reduce manufacturing time
          i.              Deploy Windows with fewer compression/decompression steps.
         ii.              Update the image faster.
       iii.              Restore the PC to factory state faster.

Limitations
1.     Support Windows 8.1 with Windows 8.1 update only.
2.     Support UEFI-based BIOS only.
3.     Support SSD and eMMC.
4.     PC with WIMBoot will not receive November Update.
5.     Some backup, antivirus, and encryption tools aren’t compatible.
6.     Run WinPE 5.1 or later.

How does it work
WIMBoot workflow:



WIMBoot partition layout:
-        Images partition contains the compressed images(install.wim, winre.wim, custom.wim)

-        Windows partition contains the pointer files to the compressed image.


                                        Comparison with WIMBoot and without WIMBoot
Items
With WIMBoot
Without WIMBoot
Fast recovery
Use DISM
Need backup space
OS size with optimized


Support multi-boot
Max file size
No Limt
2TB
Support OS
Windows 8.1 with update
Windows 7 Enterprise, Ultimate, Windows 8, Windows 8.1




Reference



中文
========================================================================
WIMBoot 是 Windows 8.1 推出的一個新功能,下面會闡述此新功能與實作的結果。

簡介
WIMBoot 是使用指標的方式,去指到 Windows 的 image 檔案,以減少硬碟空間的使用。

優點
1. 減少 Windows 空間的使用,提升客戶資料存放的空間
2. 減少工廠的工時
    - 減少工廠在製作 image 時對 image 檔案壓縮、解壓縮的步驟 (使用批次檔帶入 DISM 指令)
    - 升級 image 檔案快速 (系統升級只需替換 WIM file 即可)
    - 系統可以快速回復至出廠狀態 (Using DISM)
3. 安全的系統 (檔案都是只到 WIM file)

限制
1. 現階段只支援 Windows 8.1 with update
2. 只支援 UEFI BIOS 開機
3. 只支援 固態硬碟(SSD) 和 eMMC( Onboard flash)
4. 使用 WIMBoot 的電腦,會無法接收 11 月份之後的更新
5. 有些備份軟體、掃毒軟體和加密軟體可能會不支援

流程


WIMBoot 硬碟磁區分割狀態
    - Images partition contains the compressed images(install.wim, winre.wim, custom.wim)

   - Windows partition contains the pointer files to the compressed image.



                                        Comparison with WIMBoot and without WIMBoot
Items
With WIMBoot
Without WIMBoot
Fast recovery
Use DISM
Need backup space
OS size with optimized


Support multi-boot
Max file size
No Limt
2TB
Support OS
Windows 8.1 with update
Windows 7 Enterprise, Ultimate, Windows 8, Windows 8.1


參考資料


2015年12月14日 星期一

C# Capture Screen 截圖程式

English
========================================================================
Today I write a sample screen shot tool. I will save the picture in the application path and named by date time.

1. Use the following code can get the current application path.


2. I use the send print screen key to get image.


3. The application run like below picture.





中文
========================================================================
今天來製作一個簡單的截圖程式,並把圖檔存放在程式執行的目錄下,並利用時間來命名

1. 抓取現在程式執行的路徑方式如下


2. 抓取圖片的部分,我們使用 SendKey 的方式去處理,並把圖片顯示成在 PictureBox


3. 程式執行結果如下




2015年11月29日 星期日

C# On/Off Counter 開關機 計數器

English
========================================================================
We try to create an On/Off counter. This tool needs below function.

1. Record how many times does the tool runs. We use the Log file exist or not to determine the application has been run or not.


2. The tool run like below pictures. The tool will create the log file when tool has been run.


3. The log file includes below information.


4. The log file will update the last test time and total count.




中文
========================================================================
撰寫簡單的開關機計數器,此程式可能需要下列的功能:

1. 紀錄程式執行的次數。


此部分用先判斷程式是否有先被執行過(如果有執行過,表示 Log.txt 檔案存在),接著就是更改檔案最後一筆執行的時間和總共執行的次數

2. 程式執行結果。


第一次執行程式會判斷是否有 Log.txt 檔案,如果沒有,就創立一個 Log.txt

3. Log 檔案的內容,紀錄程式第一次執行時間、最後一次執行時間和執行次數。


4. 當程式執行多次後,Log檔案的內容變更如下圖。


2015年10月26日 星期一

C# Serial port (COM port) Send/Receive 資料傳輸

English
========================================================================
We use sample code to implement the Serial port transmission.

1. Create the Windows form project and add below code.
    First, we need to using System.IO.Ports to create the Serial Port.
    After creating the serial port, we need to initial the serial port parameters like port name, baud rate etc.


2. Add send and receive the data functions.


3. The application run like below picture. We connect the loop back at first. Thus, We can receive the data. We remove the loop back and we does not receive data anymore.




中文
========================================================================
測試 Serial port 是否正常,以下用簡單的 sample code 去實作 Serial port 的傳輸。

1. 創立新的 Windows Form Project,並加入以下程式碼;在程式碼中,可以看到要實作 Serial port,需加入 System.IO.Ports,接著就需要設定 Serial port 的參數(Port name, Baud rate...)



2. 接著在程式碼中加入,Send 和 Receive 的程式碼;Serial port 在傳送與接收資料的 function 為 WriteLine() 和 ReadExisting()


3. 程式執行起來,畫面如下,可以看到一開始有接 loop back,因此有收到資料,後面拔掉 loop back,就僅看到傳送資料的部分


2015年10月12日 星期一

C# x86, x64 platform 判斷系統為32bit, 64bit

English
========================================================================
How to detect your platform is 32 bits or 64 bits? It has an easy way to judge your platform in C#. We can use the size of IntPtr to know our platform. Here is some document on MSDN about IntPtr as below.

The IntPtr type is designed to be an integer whose size is platform-specific. That is, an instance of this type is expected to be 32-bits on 32-bit hardware and operating systems, and 64-bits on 64-bit hardware and operating systems.
The IntPtr type can be used by languages that support pointers, and as a common means of referring to data between languages that do and do not support pointers.
IntPtr objects can also be used to hold handles. For example, instances of IntPtr are used extensively in theSystem.IO.FileStream class to hold file handles.
The IntPtr type is CLS-compliant, while the UIntPtr type is not. Only the IntPtr type is used in the common language runtime. The UIntPtr type is provided mostly to maintain architectural symmetry with the IntPtr type.
This type implements the ISerializable interface.

We use an sample to detect the platform-specific.

1. New a Windows Forms Application project and add below codes.


2. We run the application in x86 platform. The result shows in below.


3. We run the application in x64 platform. The result shows in below.




Reference: MSDN



中文
========================================================================
判斷系統為 32bit 還是 64bit 最簡單的方式,就是使用 IntPtr 去計算 Size 為多少,在 x86 的環境,回傳值為 4,在 x64 的環境,回傳值為 8,以下為簡單的範例程式碼:

1. 新創一個新的 Windows Forms Application 專案,並在專案中添加以下程式碼:


2. 當程式執行於 x86 平台時,執行結果如下:


3. 當程式執行於 x64 平台時,執行結果如下:


2015年10月4日 星期日

Conception in touch 觸碰相關問題

English
========================================================================
I want to introduce some conception in touch.

1. Microsoft distinguish touch device mode from the touch control board F/W as below three modes.
    - Mouse
    - Single-input
    - Multi-input
2. Both DSP and OEM FES version use same core. The touch function are same.
3. The Windows touch logo certification is created by Microsoft. One of the condition to certificate the certification is the touch need support multi-touch.
4. The THQA certification effect the completely of touch user experience.
5. Microsoft distinguish the touch user experience to two scenarios.
    - Full touch: The full Windows 8 experience.
    - Legacy touch: Similar to the full Windows 8 experience with the following exception.
        - Widows edge UI values are adjusted to relax edge triggering from 1 pixel to 20 pixels to better accommodate finger swipes from the edges of the display.
        - There is no Windows touch prediction that provides faster, crisper interaction.
        - There is no ability to swipe to reveal accent keys on the Windows On-Screen keyboard.
6. SW RD manual change the touch mode to mouse. It's not an touch. It only can call mouse or mouse touch.

Viewpoint by Windows.
                                                        Table 1. Product list for touch
Product
Full touch support
Mouse touch support
WES7 E
Not support
Support*¹
WES7 P
Support
Support
WES7 Pro
Support
Support
Win7 DSP
Support*²
Support*²
WE8S
Support
Support
Win8.1 Pro
Support
Support
Win8.1 DSP
Support*²
Support*²
Win 10
Support
Support



Viewpoint by Product

                                                    Table 2. Product list for touch
Product
Resistive touch
PCT touch
WES7 E
Not Support*¹
Not Support*¹
WES7 P
Support
Support
WES7 Pro
Support
Support
Win7 DSP
Not Support*²
Support
WE8S
Support
Support
Win8.1 Pro
Support
Support
Win8.1 DSP
Not Support*²
Support
Win 10
Support
Support

¹ WES7 E sku does not support the touch. If the vendor can modify the touch driver, it can use mouse touch in WES7 E sku.
² DSP version does not support when touch panel is resistive panel.



中文
========================================================================
由於公司遇到一些 touch 相關的問題,簡單的先補充一些 touch 觀念:

1. 在微軟根據 touch control board F/W 認定的 touch device mode 主要分成以下三種:
    - Mouse 
    - Single-input
    - Multi-input
2. 在 DSP 和 OEM FES 版本使用同一個 core,並不影響 touch 功能
3. 微軟有一個 Windows touch logo 認證,此認證其中一項條件為須滿足多點觸碰
4.  Touch panel 廠商是否有過 THQA 認證,影響的是 touch user experience 的完整性
5.  在 Windows 8中,微軟把 touch user experience 分成 Full touch 和 Legacy touch 兩種版本
    - Full touch:擁有Windows 8  user experience
    Legacy touch:相似於 full touch,但擁有以下的例外
                                               - 當手指從螢幕邊緣滑進來,偵測的敏感度從 1 pixel 變成 20pixel
  - 沒有提供快速、互動式的關聯式輸入法
  - 螢幕小鍵盤功能不齊全
6. 軟體RD手動更改 touch 為 mouse mode(顯示為滑鼠游標),此行為並非 touch,只能算是 mouse 或是 mouse touch


 Windows的觀點來看,可以分成如下圖:

                                                                                                                                Table 1. Product list for touch
Product
Full touch support
Mouse touch support
WES7 E
Not support
Support*¹
WES7 P
Support
Support
WES7 Pro
Support
Support
Win7 DSP
Support*²
Support*²
WE8S
Support
Support
Win8.1 Pro
Support
Support
Win8.1 DSP
Support*²
Support*²
Win 10
Support
Support



從產品的觀點來看,可以分成如下表:

                                                    Table 2. Product list for touch
Product
Resistive touch
PCT touch
WES7 E
Not Support*¹
Not Support*¹
WES7 P
Support
Support
WES7 Pro
Support
Support
Win7 DSP
Not Support*²
Support
WE8S
Support
Support
Win8.1 Pro
Support
Support
Win8.1 DSP
Not Support*²
Support
Win 10
Support
Support
¹ WES7 E這個 sku 是否 support mouse touch,主要是 Driver 決定,如果 driver 廠商可以把 touch device mode 設定為 mouse mode,即可在 E sku 使用 mouse touch
² DSP 版本無法 support,是因為電阻式的 panel 無法過 Windows touch logo 認證,所以電阻式的 panel在 DSP 版本基本上是無法使用 touch 的,如果要使用 mouse touch,也要看 driver 廠商是否 support

OS Operating System 作業系統 恐龍書 筆記分享

發現一個作業系統說明的網站, 對於 process vs thread, semaphore vs mutex, deadlock 說明很詳細, 有興趣的人可以去以下的網頁逛逛。 附上網址連結: link   link2