2010년 5월 15일 토요일

2010년 5월 14일 금요일

디스크 초기화

clearhdd 1 타이핑후 y를 선택한다음 재부팅 하면 된다.

 

mbr(master boot record) 을삭제해야한다.

MBR은 파티션 위치정보를 가지고 있다.그리고 운영체제가 저장되어있는 파티션의 부트섹터를

읽어올수있는 프로그램을 포함하고 있다.

부트섹터에는 OS를 메모리에 올릴수있는 프로그램이 내장되어 있다

 

FDISK 는 파티션을 나누는 즉 디스크영역을 만드는 것이고

FDISK /mbr 은 mbr영역까지 삭제하는 명령이다.

 

실제로 Fdisk/mbr은 mbr영역중 파티션테이블 64byte를 제외한 나머지 mbr영역을 fdisk가 다시

기록해주는 것이다.

파티션테이블을 제외한 mbr영역이 손상되었을때 복구하는 도구로 사용된다.

파티션테이블 손상시에는 다른 복구유틸이나 백업본을 이용해야한다.

 

 

2010년 5월 13일 목요일

해킨토시 설치하기

The first time I installed OSX on my P1610 I used Kalyway 10.5.2, it was pretty successful,
but there were a few remaining issues and it was a lot of hard work.
Quite a few months down the line and much has improved in the world of hackintosh,
My latest install is with iAtkos v7, which can be found at any good torrent search.

I do suggest burning the disc at the slowest speed possible to minimise errors on the DVDR.
Here is how I installed iAtkos v7 OS X 10.5.7 on my Fujitsu P1610.
I'm not guaranteeing it will work for you, it's just how I did it.

MANY MANY THANKS to all that put the work in to make this possible.


<Preparation>
-------------
The very first thing I did was replace the standard Atheros WiFi card in my P1610,
with a Airport compatible 802.11N Broadcom based WiFi card, that I picked up off eBay.
No idea if iAtkos v7 supports the original Atheros card as I got rid of ages ago.

Downloaded and burned the iAtkos v7 disc image at x2 speed.

Plug in my external USB DVD rom and put the iAtkos v7 disc in.
Turn on your Fujitsu Lifebook P1610 and at the POST screen hit F2 to enter the BIOS.
In the BIOS go over to Boot and down to Boot Device Priority.
in the list of Boot priority order, I removed everything except CD/DVD drive,
hit x to remove or add a device to the list.
Hit F10 to save and exit, then enter to confirm.


<Installation>
--------------
Boot from CD/DVD drive and at the Darwin loader
press F8 for options and type -v to boot in verbose mode.
Once the installer loads up
click the button to continue

under utilities menu
click on Disk Utility

Select the drive in your P1610, then choose the Partition tab.
You could create just one partition if you want just Mac OS X, format it in Mac OS Extended (Journaled) format.

----
I have mine setup as a dualboot, Mac OS X and Windows XP Tablet.
So created two equal sized paritions the first being a Mac OS Extended (Journaled)
the second being (MS-DOS) FAT so I can install Windows XP Tablet to it.
Once the partitions are created,
I then install Windows XP Tablet as I normally would, during the XP installation I reformat the FAT partition to NTFS.
Since it doesn't see the Mac OS Extended (Journaled) partition there is no issues here.
After installing Windows XP, boot from the iAtkos disc again with F8 and typing -v.
----

Agree to the edited iAtkos license agreement,
Select a Destination - click on the Mac OS partiton, then continue
Install Summary - Customize
(the following are the options I used, they may not be the best, but they work for me.)

-iATKOS v7 Main System

-Bootloader
--Chameleon v2

-X86 Patches
--/Extra directory
--DSDT
--Decrypters
---AppleDecrypt
--SMBIOS drivers
---SMBIOS Enablers
----SMBIOS Resolver
---SMBIOS' for X86
----AppleSMBIOS-28
--Kernel
---9.7.0 Kernel voodoo
--Disabler

-Drivers
--VGA
---Intel
----GMA 950
-----GMA 950 Laptop
--System
---SATA/IDE
----Generic IDE
---CardBus Driver
---USB
---Sound
----Voodoo HDA driver
---PS/2 mouse/keyboard
----Apple PS/2 driver
---Laptop Battery
---NTFS-3G
---Network
----Wireless
-----Broadcom BCM43xx

-Post-Install Actions


Click Done, then Install


<Setup>
-------
Once the Install has succeeded, click restart,
and when you get the Fujitsu POST screen hit F2 to go into the BIOS
Unplug the USB DVD drive
Remove the CD/DVD drive from the Boot priority order,
and re-add the hard drive Drive0:
Press F10 to save and exit, then enter to confirm.
When you get the Chameleon boot screen, push down three times to select Boot Verbose and hit enter.

OSX will start up and you should hear some funky music playing out the speakers,

Select Country
Keyboard
Dou you already own a mac? - Continue
Select a wireless Service
Enter your Apple ID - you can leave it blank and hit Continue
Registration Information - Alt+Q to skip
Create Your Account Name and a password
Select Time Zone
Set the Date and Time
Don't Forget to Register - Done


<Display> 반드시 설정해야한다 .
---------
First things first, set the correct screen resolution.
Click on System preferences, the metallic looking Cogs icon at the bottom
then under the Hardware heading, Displays.
select 1280x768 to get the correct resolution.

/Library/Preferences/SystemConfiguration/com.apple.Boot.plist 에서

<key>Graphic Mode</key>

<string>1280*768*32</string>

를 입력후 저장 한다 맨 아래쪽에

만약 하지 않게 되면 재부팅 했을경우 gui를 볼수 없게 된다.



<Ethernet Networking>
---------------------
1. 터미널 실행
2. sudo -s 실행(관리자 권한 획득)
3. 관리자 암호 입력
4. vi /System/Library/Extensions/IONetworkingFamily.kext/Contents/Plugins/AppleYukon2.kext/Contents

/Info.plist

아래 색칠된 부분 수정

<key>Yukon-88E8055</key>
        <dict>
            <key>CFBundleIdentifier</key>
            <string>com.apple.iokit.AppleYukon2</string>
            <key>EnableLowPwr</key>
            <integer>1</integer>
            <key>IOClass</key>
            <string>yukon2osx</string>
            <key>IOPCIPrimaryMatch</key>
            <string>0x436311ab</string>
            <key>IOPCISecondaryMatch</key>
            <string>0x139a10cf</string>
            <key>IOProviderClass</key>
            <string>IOPCIDevice</string>
            <key>InitialWaitForLinkUp</key>
            <string></string>
            <key>MACNumber</key>
            <integer>1</integer>
            <key>Model</key>
            <string>Yukon Gigabit Adapter 88E8055 Singleport Copper SA</string>
            <key>NetworkNumber</key>
            <integer>6000</integer>
            <key>Vendor</key>
            <string>marvell</string>
        </dict>


5. rm /System/Library/Extensions.mkext
6. diskutil repairPermissions /
7. reboot


<Keyboard layout>
-----------------
http://www.insanelymac.com/forum/index.php...st&p=767201
download and install the Microsoft Keyboard layouts,
once that's done, restart the computer and go into System Preferences and select International.
Select Input Menu.
scroll through and check the box for the keyboard you have.
mine is British - Microsoft.
Then up in the top right you'll see a little Flag where you can click on to change the keyboard layout.


<Upgrade to 10.5.8>
-------------------
Click on the Apple icon, top right, and select Software update,
uncheck the 10.5.8 update for now, and update everything else.
once it's all updated and restarted, check for updates again,
hopefully there is now only the 10.5.8 update left.
Check that and apply that update, it takes a while,
but it should restart a couple of times and you'll now have 10.5.8 running on your P1610.


<Things that are not working>
-----------------------------
Touchscreen, Buttons on the screen bezel, SD card reader.
I don't think I'm going to be able to get the Touchscreen to work,
as the P1610 uses a serial touchscreen controller, which there doesn't seem to be any support for.
Again the same for the buttons on the screen bezel, no support.
But I reckon with a bit more hunting around I should be able to get the SD card reader working. Hopefully.

2010년 5월 7일 금요일

파일을 DB처럼 사용하는법

class CInfo
{
public:
char szName[40];
char szPhone[40];
char szMobile[40];
char szAddress[40];
char szEmail[40];
char szEtc[1024-40*5-7];
char szn[3];


CInfo(){
  memset(szName, 0 ,sizeof(char)*40);
  memset(szPhone, 0 ,sizeof(char)*40);
  memset(szMobile, 0 ,sizeof(char)*40);
  memset(szAddress, 0 ,sizeof(char)*40);
  memset(szEmail, 0 ,sizeof(char)*40);
  memset(szEtc, 0 ,sizeof(char)*1024-40*5-7);
  memset(szn,0,sizeof(szn));
  strncpy(szn,_T("\r\n"),sizeof("\r\n"));
}
};

1.데이터 삽입(Insert)



void CFileDB::InsertInFile(CInfo &Info)
{


m_hFile = CreateFile(_T("c:\\test001.dat"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

DWORD nWrite = 0;

SetFilePointer(m_hFile,0,NULL,FILE_END);

//WriteFile(m_hFile,_T("\n"),sizeof("\n"),&nWrite,NULL);




if(m_hFile != INVALID_HANDLE_VALUE)
{
  WriteFile(m_hFile,&Info,sizeof(Info),&nWrite,NULL);
}

CloseHandle(m_hFile);


}



2.데이터 조회(Select)



void CFileDB::SelectInFile(void)
{

UpdateData(TRUE);


DWORD dwStartTime, dwFinishTime;
CInfo Info;
memset(&Info,0,sizeof(Info));



m_hFile = CreateFile(_T("c:\\test001.dat"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

SetFilePointer(m_hFile,0,NULL,FILE_BEGIN);

int nNumOfData = GetFileSize(m_hFile,NULL)/sizeof(CInfo);

DWORD nRead = 0;

if(m_hFile != INVALID_HANDLE_VALUE)
{
  for(int i = 0 ; i< nNumOfData ; ++i)
  {
   SetFilePointer(m_hFile,sizeof(Info)*i,NULL,FILE_BEGIN);
   ReadFile(m_hFile,&Info,sizeof(Info),&nRead,NULL);

   if(m_strNameSearch.Compare(Info.szName) == 0 )
   {
    // 데이타를 표시한다.
    m_uIndex = i;
    m_strName = Info.szName;
    m_strPhone = Info.szPhone;
    m_strMobile = Info.szMobile;
    m_strAddress = Info.szAddress;
    m_strEmail = Info.szEmail;
    dwFinishTime = GetTickCount();
    m_uTime = 0;

   }
  }
 
}

CloseHandle(m_hFile);

UpdateData(FALSE);

}



3.데이터 수정(Update)



void CFileDB::UpdateInFile(void)
{

UpdateData(TRUE);


DWORD dwStartTime, dwFinishTime;
CInfo Info;
memset(&Info,0,sizeof(Info));

m_hFile = CreateFile(_T("c:\\test001.dat"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);

SetFilePointer(m_hFile,0,NULL,FILE_BEGIN);

int nNumOfData = GetFileSize(m_hFile,NULL)/sizeof(CInfo);

DWORD nRead = 0;
DWORD nWrite = 0;

if(m_hFile != INVALID_HANDLE_VALUE)
{
  for(int i = 0 ; i< nNumOfData ; ++i)
  {
   SetFilePointer(m_hFile,sizeof(Info)*i,NULL,FILE_BEGIN);
   ReadFile(m_hFile,&Info,sizeof(Info),&nRead,NULL);

   if(m_strNameSearch.Compare(Info.szName) == 0 )
   {
    // 데이타를 표시한다.
    m_uIndex = i;
    strncpy(Info.szName,m_strName,strlen(m_strName));
    strncpy(Info.szPhone, m_strPhone,strlen(m_strPhone));
    strncpy(Info.szMobile, m_strMobile,strlen(m_strMobile));
    strncpy(Info.szAddress, m_strAddress,strlen(m_strAddress));
    strncpy(Info.szEmail, m_strEmail,strlen(m_strEmail));
    dwFinishTime = GetTickCount();
    m_uTime = 0;

    SetFilePointer(m_hFile,sizeof(Info)*i,NULL,FILE_BEGIN);
    WriteFile(m_hFile,&Info,sizeof(Info),&nWrite,NULL);

    MessageBox(_T("수정이 완료되었습니다."));

   }
  }

}

CloseHandle(m_hFile);

UpdateData(FALSE);

}



4.데이터 삭제(Delete)

void CFileDB::DeleteInFile(void)
{
CInfo Info;
DWORD nRead = 0;
DWORD nWrite = 0;

BOOL bCompare = FALSE;


m_hFile = CreateFile(_T("c:\\test001.dat"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
SetFilePointer(m_hFile,0,NULL,FILE_BEGIN);

int nNumOfData = GetFileSize(m_hFile,NULL)/sizeof(CInfo);

if(m_hFile != INVALID_HANDLE_VALUE)
{
  for(int i = 0 ; i< nNumOfData ; ++i)
  {
   SetFilePointer(m_hFile,sizeof(Info)*i,NULL,FILE_BEGIN);
   ReadFile(m_hFile,&Info,sizeof(Info),&nRead,NULL);

   if(m_strName.Compare(Info.szName) == 0 )
   {
    bCompare = TRUE;
   
   }

   if(bCompare)
   {
    //바로 뒤에 있는 데이터를 읽어서
    SetFilePointer(m_hFile,sizeof(Info)*(i+1),NULL,FILE_BEGIN);
    ReadFile(m_hFile,&Info,sizeof(Info),&nRead,NULL);
    //데이터를 삭제한 곳에 덮어쓴다.
    SetFilePointer(m_hFile,sizeof(Info)*i,NULL,FILE_BEGIN);
    WriteFile(m_hFile,&Info,sizeof(Info),&nWrite,NULL);  

   }


  }
}

if(bCompare)
{
  CInfo blank;
  memset(&blank,0,sizeof(CInfo));
  SetFilePointer(m_hFile,sizeof(CInfo)*(nNumOfData -1),NULL,FILE_BEGIN);
  WriteFile(m_hFile,&blank,sizeof(blank),&nWrite,NULL);

  MessageBox(_T("삭제가 완료되었습니다."));

}

CloseHandle(m_hFile);

}