Windows XP, after write boot sector of Drive C, my computer hang up
Power off, and restart, system crash

(I tried write bootsector of Win98 in bootsector of Drive C of WinXP)

Help me
Thanks
Posted on 2005-03-29 19:28:28 by Ctrl+Break
http://kos.enix.org/pub/bootwrit.html

Maybe there's some help here.

Kydwyn
Posted on 2005-03-29 20:05:03 by Kydwyn
No, I wrote win98 boot sector to Boot sector of Driver C, and system crash
My compuer installed Windows XP

Tell me solution to system not crash before restart.

I don't write a bootsector, this is very simply
Posted on 2005-03-29 20:56:09 by Ctrl+Break
Ctrl+Break,

Boot from your Windows XP CD, select 'To repair a Windows XP installation using the recovery console, press R', then run FIXMBR in the recovery console. Worth a try.

Here is a good link about using the Recovery Console:

http://www.wown.com/j_helmig/wxprcons.htm

Posted on 2005-03-29 21:27:27 by Greg
Boot sector is ok if you can boot up the OS. It has no connection with system shutdown.
Perhaps you had a dual-boot ? So after writing Win98 bootsector with fdisk /mbr you cant boot winXP?
Or while trying to install winXp you get a crash?
Posted on 2005-03-30 02:09:01 by Azrim
In any case you can upgrade WinXp to WinXp with no problems if you think that something is corrupted.
Before that you could try START>Run sfc /scannow (you will need winXp CD)

best regards
Posted on 2005-03-30 02:12:27 by Azrim
Nonono, My Question:
after write boot sector of Windows 98 into bootsector of Drive C, system no crash before reboot,
how to do ?
Posted on 2005-03-30 02:48:48 by Ctrl+Break
Afternoon, Ctrl+Break.


Nonono, My Question:
after write boot sector of Windows 98 into bootsector of Drive C, system no crash before reboot,
how to do ?


Why are you wishing to do this?
Are you attempting to avoid security (password) protection on a computer?

Cheers,
Scronty
Posted on 2005-03-30 05:01:32 by Scronty
I writing an IO program. but i couldn't wrote a kmd.
My Solution: When run: my program will write boot sector of drive c by boot sector of win98 and restart 
After finish, program restore boot sector of drive C and restart
I have administrator privilege. However, i couldn't do it

code:
.386
.model flat, stdcall
option casemap:none

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                  I N C L U D E  F I L E S                                       
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

include C:\masm32\include\windows.inc

include c:\masm32\include\kernel32.inc
include c:\masm32\include\user32.inc
include c:\masm32\include\gdi32.inc

includelib c:\masm32\lib\kernel32.lib
includelib c:\masm32\lib\user32.lib
includelib c:\masm32\lib\gdi32.lib

include c:\masm32\Macros\Strings.mac

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                      E Q U A T E S                                               
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::


MBR_SIZE equ 512

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                              U N I N I T I A L I Z E D  D A T A                                 
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

.data?

MBR BYTE MBR_SIZE dup(?)

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                      C O D E                                                   
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

.code


;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                      start                                                     
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

start proc uses esi ebx

local hDevice:HANDLE
local dwNumberOfBytesRead:DWORD
local hFile: HANDLE
invoke CreateFile, $CTA0("\\\\.\\C:"), GENERIC_WRITE+GENERIC_READ, \
FILE_SHARE_READ + FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL
.if eax != INVALID_HANDLE_VALUE

mov hDevice, eax

invoke CreateFile, $CTA0("boot.bin"), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL,NULL
mov hFile, eax

invoke ReadFile, hFile, addr MBR, MBR_SIZE, addr dwNumberOfBytesRead, NULL
invoke WriteFile, hDevice, addr MBR, MBR_SIZE, addr dwNumberOfBytesRead, NULL

invoke  CloseHandle, hFile
invoke CloseHandle, hDevice               
.else
invoke MessageBox, NULL, $CTA0("Couldn't open PhysicalDrive0 device"), NULL, MB_ICONEXCLAMATION
.endif

invoke ExitProcess, 0

start endp

;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;                                                                                                 
;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

end start
Posted on 2005-03-30 06:26:28 by Ctrl+Break
When using using Read/WriteFile on disk or partitions, your buffers (and reads) must be 512-byte aligned. Allocate the "MBR" buffer with VirtualAlloc. Also, where does the error happen? You don't have nearly enough error checks.

And then of course there's the obvious thing - wtf are you doing this? Overwriting the MBR is a dangerous thing to do. Especially if you don't want your partition table smashed.
Posted on 2005-03-30 08:46:02 by f0dder
I don't overwrite MBR, i overwrite Boot Sector.
Posted on 2005-03-30 19:12:27 by Ctrl+Break