バックナンバーはこちら。
https://www.simulationroom999.com/blog/In-vehicle-external-storage-backnumber/
はじめに
FatFsのメモリ上シミュレーションの話。
FatFsのビルド環境準備してみる。
開発環境はWindowsを想定しているため、マイクロソフト社製の例のアレを使用。
そのままだとビルドができないこともあるらしいので、ちょっとプロジェクトを修正したり。
そしてついにFatFs起動。
(WinXP時代は直接HDDを・・・。)
登場人物
博識フクロウのフクさん

イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん

イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
FatFsのビルド

とりあえず、ビルド環境としては
Visual Studio 2017 expressを使用する。

今までもよく使ってきた環境だねー。

Visual Studio 2017 expressがインストールできていることを前提に話を進める。

まずは、ffdev.slnを開けばいいのかな?


Visual Studio 2017用にupgradeするか聞かれるのでそのままupgradeでOKだ。

そのままビルドしようとしたらエラーが出た・・・。
エラー MSB8036 Windows SDK バージョン 8.1 が見つかりませんでした。必要なバージョンの Windows SDK をインストールするか、プロジェクト プロパティ ページで SDK バージョンを変更するか、ソリューションを右クリックして [ソリューションの再ターゲット] を選択してください。 ffdev C:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\Common7\IDE\VC\VCTargets\Microsoft.Cpp.WindowsSDK.targets 46

該当するプロジェクトに設定されてるWindows SDKがないんだな。
プロジェクトのプロパティの
構成プロパティ→全般でSDKを再設定する必要があるね。


Windows SDKはどのversionでもいいの?

特にWindows SDKのversionに依存したコードは居ないはずなので、
何を選んでもOKなはずだ。

じゃ、一番新しそうなのを選んでおこう。

でわ、あらためてビルド!

よし!
こんどはビルドは通ったぞ!

とりあえず、そのまま実行してみよう。
ffsample起動

なんか起動した。


英文で書かれてるけど、
「Windows Vista以降は物理ドライブにアクセスできない」
的なことが書かれているね?

WindowsXP以前だと直接PCのハードディスクとかリムーバブルディスクにアクセスできたみたいだね。
Vista以降だと、OS側でガードが入ってアクセスできないように仕様変更が入ったのだと思う。

PCのHDDにアクセスって・・・。
それってなんかすごいけど、怖いな・・・。

まぁ我々の今の環境はWindows10なんで、HDDへのアクセスは不可ってことだな。

とりあえず、メモリ上での動作確認の準備は出来たって感じかな?

そうだね。
FatFsを操作する上での前提知識とかもあるんで、
次回はそこら辺を説明しよう。
まとめ

まとめだよ。
- FatFsのビルド環境準備。
- Visual Studio 2017 expresを使用。
- プロジェクトに設定されているWindows SDKが入っていない場合があるので構成プロパティで設定変更が必要。
- FatFs起動。
- WindowsXP以前だとPCのHDDに直接アクセスできたらしい。
バックナンバーはこちら。
コメント