2017年5月26日金曜日

PowerEdge T130 で、Windows Server 2008 R2 セットアップのキーボード・マウスが操作できない!

簡単な解決方法(未確認)
  • BIOS に入ります。
  • System BIOS Settings → Integrated Devices → USB 3.0 Setting → Disabled

難しい解決方法
  • Windows インストールディスクの boot.wim に USB 3.0 ドライバーを注入します。
  • 更新した boot.wim を含む DVD を作成し、それを使ってインストールを実施します。


参考:
How to inject USB 3.0 drivers into Windows Server 2008 R2SP1 for use on Dell PowerEdge R230, R330, T130, T330 and T30
http://en.community.dell.com/techcenter/b/techcenter/archive/2016/05/15/how-to-inject-usb-3-0-drivers-into-windows-server-2008-r2sp1-for-use-on-dell-r230-r330-t130-t330

syslinux 6 で WinPE を起動したい

用意するファイル

VistaPE などで作成した boot.wim から、7-zip などを使ってこれらのファイルを取り出してください:

\BOOTMGR
\Boot\bcd
\Boot\boot.sdi
\Boot\en-us\*
\Boot\fonts\*
\Boot\ja-JP\*

cfg ファイルの書き方

LABEL -
MENU LABEL ^WinPE BOOTMGR
COM32 /boot/syslinux/chain.c32
APPEND fs ntldr=/BOOTMGR

bcdedit で \boot\bcd ファイルを修正

bcdedit は使う OS のバージョンには特に影響しないようです。




C:\A>bcdedit /store bcd /copy {default} /d "MyPE_x86"
エントリは {5841949e-415a-11e7-bff0-d43d7e05f256} に正常にコピーされました。

C:\A>bcdedit /store bcd /set {5841949e-415a-11e7-bff0-d43d7e05f256} device ramdisk=[boot]\sources\MyPE_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
この操作を正しく終了しました。

C:\A>bcdedit /store bcd /set {5841949e-415a-11e7-bff0-d43d7e05f256} osdevice ramdisk=[boot]\sources\MyPE_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
この操作を正しく終了しました。

C:\A>bcdedit /store bcd /displayorder {5841949e-415a-11e7-bff0-d43d7e05f256} /addlast
この操作を正しく終了しました。

C:\A>bcdedit /store bcd

Windows ブート マネージャー
--------------------------------
identifier              {bootmgr}
description             Windows Boot Manager
locale                  ja-jp
inherit                 {globalsettings}
default                 {default}
displayorder            {default}
                        {5841949e-415a-11e7-bff0-d43d7e05f256}
toolsdisplayorder       {memdiag}
timeout                 30

Windows ブート ローダー
--------------------------------
identifier              {default}
device                  ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
path                    \windows\system32\boot\winload.exe
description             Windows Setup
locale                  ja-jp
inherit                 {bootloadersettings}
osdevice                ramdisk=[boot]\sources\boot.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
systemroot              \windows
detecthal               Yes
winpe                   Yes
ems                     Yes

Windows ブート ローダー
--------------------------------
identifier              {5841949e-415a-11e7-bff0-d43d7e05f256}
device                  ramdisk=[boot]\sources\MyPE_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
path                    \windows\system32\boot\winload.exe
description             MyPE_x86
locale                  ja-jp
inherit                 {bootloadersettings}
osdevice                ramdisk=[boot]\sources\MyPE_x86.wim,{7619dcc8-fafe-11d9-b411-000476eba25f}
systemroot              \windows
detecthal               Yes
winpe                   Yes
ems                     Yes

C:\A>




2017年5月2日火曜日

palloc で access violation … Visual Studio 2005 で作った PostgreSQL 8.2 の C 関数にて

BUILDING_DLL を定義したらダメみたいです。

参考: Re: Access violation from palloc, Visual Studio 2005, C-language function

include/server/utils/palloc.h に定義があります。

/*
 * Type MemoryContextData is declared in nodes/memnodes.h. Most users
 * of memory allocation should just treat it as an abstract type, so we
 * do not provide the struct contents here.
 */
typedef struct MemoryContextData *MemoryContext;

/*
 * CurrentMemoryContext is the default allocation context for palloc().
 * We declare it here so that palloc() can be a macro. Avoid accessing it
 * directly!  Instead, use MemoryContextSwitchTo() to change the setting.
 */
extern DLLIMPORT MemoryContext CurrentMemoryContext;

/*
 * Fundamental memory-allocation operations (more are in utils/memutils.h)
 */
extern void *MemoryContextAlloc(MemoryContext context, Size size);
extern void *MemoryContextAllocZero(MemoryContext context, Size size);
extern void *MemoryContextAllocZeroAligned(MemoryContext context, Size size);

#define palloc(sz) MemoryContextAlloc(CurrentMemoryContext, (sz))

#define palloc0(sz) MemoryContextAllocZero(CurrentMemoryContext, (sz))

MemoryContextAlloc や CurrentMemoryContext は、インポートライブラリを利用して postgres.exe プロセスからインポートします。

---
結論から申しますと、つぎのようにあるべきが、

extern __declspec (dllimport) MemoryContext CurrentMemoryContext;

BUILDING_DLL を定義することで、つぎのように変化することが問題でした。

extern __declspec (dllexport) MemoryContext CurrentMemoryContext;

---
それでは納得できないこともあろうかと、アセンブラレベルで解析もしました。

palloc するだけの C 関数:
PG_FUNCTION_INFO_V1(ddtest);
Datum ddtest(PG_FUNCTION_ARGS) {
 palloc(0x123456);
 PG_RETURN_NULL();
}

まず、
extern __declspec (dllimport) MemoryContext CurrentMemoryContext; となる場合。


緑下線を引いた部分 100470F8 が CurrentMemoryContext の実体のアドレスです。そこに意味のあるコードはありませんが一応。88 87 04 00 の部分が MemoryContextSwitchTo を呼び出すことで、本来の値に書き換えられるわけです。


つぎに、
extern __declspec (dllexport) MemoryContext CurrentMemoryContext; となる場合。


緑下線を引いた部分が <CurrentMemoryContext> になっています。一見これが正解じゃないかと思いますが、参照先は jmp dword ptr [0x100470f8] の命令コードです。



0x70f825ff に 4 を足した 0x70f82603 にアクセスしようとして、access violation が発生することが冒頭のエラーにつながります。

『postgres.exe の 0x005fbb4a で初回の例外が発生しました: 0xC0000005: 場所 0x70f82603 を読み込み中にアクセス違反が発生しました。』

外部の exe/dll からインポートする変数は、__declspec (dllimport) を使いましょう。

2017年4月26日水曜日

Interoperability 相互運用性 を最大限にする! とは

どういうことでしょうか…?

つまり、再利用可能な要素を多分に含む、ということです!

HTML に対する XML と同じ考え方です。

つまり、画面表示の要素と、データを分離する、ということです。

そうするとデータの機械処理や流用が楽になります。

要検討事項:
  • 詳細なデータを確認したい場合。
  • 検証可能性を明らかしたい場合。

2017年4月3日月曜日

SQL Server Browser サービス グループが存在しません。…


現象:

Microsoft SQL Server 2014 セットアップ

SQL Server Browser サービス グループが存在しません。セットアップでエラーが発生していないか確認してください。

対策:

手順:
  • secpol.msc
  • [ユーザー権利の割り当て]→[サービスとしてログオン]
  • "NT SERVICE\MSSQL$MICROSOFT##WID" を追加
  • [OK]
  • [セキュリティの設定]右クリック→[再読み込み]

2017年2月3日金曜日

Redmine 3.2-stable on IIS 8.0 +Helicon Zoo


トラブルシューティングや Tips 集です

環境
  • Windows Server 2012 (6.2)
  • IIS 8.0
  • railsinstaller-3.2.1.exe
  • redmine 3.2-stable

参考資料:RedmineをWindowsにインストールする手順書作ったよ
http://shoutatani.hatenablog.com/entry/2015/09/21/121955

Ruby 2.2 にしたのは… Ruby 2.3 には PostgreSQL 用バイナリドライバーがないからでした。
[tid-3258816] cannot load such file -- 2.3/pg_ext (LoadError)

特定のタイミングで、Gemfile.lock を書き換えます。htmlentities 4.3.1 → 4.3.4
   htmlentities (4.3.4)

これは、warning: key "inodot" is duplicated and overwritten という件に対応するためです。
   rbpdf (1.19.0)
     htmlentities (= 4.3.4)
     rbpdf-font (~> 1.19.0)


Subversion を認識しない…? 赤印がつく。
  • svn コマンドを実行できるが落ちてしまう(%LOCALAPPDATA% が未定義のため)
    これは、IIS がユーザープロファイルをロードしないでワーカープロセスを実行するからです。
    対策:
    アプリケーションプール
    redmine
    詳細設定
    ユーザープロファイルの読み込み = True

Helicon Zoo に ruby.2.2.rack を追加したい:

IIS、Server ホーム、管理、構成エディター

セクション=system.webServer/heliconZooServer 


... ボタンより、engines の一覧に移ります。

このような内容で追加します:

 environmentVariables の中:

redmine3 の方の Helicon Zoo

rails.project の詳細。Inherited は ruby.2.2.rack から継承されているもので、変更していません。

WORKER_REQUEST_TIMEOUT は 86400 とか長いほうがいいかもしれません。起動が重いので。


2017年2月2日木曜日

Helicon Zoo - Application backend read Error

redmine の場合、log フォルダーを確認


RAILS_ENV を確認するべし。production なのか、development なのか。