Loading an SDI RAMDisk Image from DOS (Syed / Slobodan)

G

Guest

Our network infrastructure does not support PXE, however we would like to boot devices that do not contain persistent storage. Could you help us get an SDI Ramdisk image loading from DOS? According to the whitepaper, it seems like a possible solution

Concept
1. Boot from DOS TCP/IP network boot disk, or DOS bootable CD
2. Copy SDI image to RAM (from network share or local CD drive
3. RAM boo

Saad, can you help me get started with coding steps 1 through 3 of your whitepaper? Slobodan, it looked like you had some code working in other threads. Can you share? I could really use some help. :-

Thank you!
 
S

Slobodan Brcin

Find Ralf Brown's interrupt lists.
Info that missing in Saad doc is how to copy to memory above 1MB and at what
location (safe location).
For mem copy use:
mov ah, 87h
int 15h

Dest address must be much higher than 2 MB I'm using start address 64 MB ant
it is working.

Concept:
1a. Have not idea how to read network from DOS must be some int extension to
do this. Long time ago, when I was using (programming for) DOS the concepts
of having network was something unimaginable to me :)
1b. For CD you don't need DOS, you should write bootloader that will load
from fixed part of CD SDI data to high memory.
You can use int 13h to read data and int15h to copy them in blocks of 16 or
32 KB. Very simple.
Then you will need to write simple util (or use hex editor) to insert
bootloader data and SDI data to one file.
Then write this file to boot part of CD.

2. covered with 1
3. read Saad's doc.

If your device supports PXE boot then it would be sin to use DOS and TCP/IP
to fetch data.

Regards,
Slobodan

Don Noonan said:
Our network infrastructure does not support PXE, however we would like to
boot devices that do not contain persistent storage. Could you help us get
an SDI Ramdisk image loading from DOS? According to the whitepaper, it
seems like a possible solution.
Concept:
1. Boot from DOS TCP/IP network boot disk, or DOS bootable CD.
2. Copy SDI image to RAM (from network share or local CD drive)
3. RAM boot

Saad, can you help me get started with coding steps 1 through 3 of your
whitepaper? Slobodan, it looked like you had some code working in other
threads. Can you share? I could really use some help. :)
 
G

Guest

Slobodan

Really appreciate your feedback! Thank you very much. You're exactly right about PXE. I started down that path, however our network is very large and would require significant work to get PXE working on all subnets. That is why I thought that a standard MS TCP/IP network boot disk would be a good mechanism to boot the machine and pull an SDI from a network share
If you could provide any info about switching between protected and real mode (and when you actually need to), that would be great! Also, what assembler are you using

Thank you

Don
 
S

Slobodan Brcin

No switching from protected to user and vive versa is required.
Just use int vector I provided it is mem copy function, let BIOS do the job
for you.

I can provide you with info about switching to protected mode but it is
unnecessary hassle.

I'm using ml.exe.

You have it in Windows DDK, and also it comes with Microsoft Visual Studio.
Also you will need to use EXE2BIN.

Regards,
Slobodan

Don Noonan said:
Slobodan,

Really appreciate your feedback! Thank you very much. You're exactly right
about PXE. I started down that path, however our network is very large and
would require significant work to get PXE working on all subnets. That is
why I thought that a standard MS TCP/IP network boot disk would be a good
mechanism to boot the machine and pull an SDI from a network share.
If you could provide any info about switching between protected and real
mode (and when you actually need to), that would be great! Also, what
assembler are you using?
 
K

KM

Don,

This might be irrelevant to you question but considering your concept item
#2 if you have a local CD drive XPe boot option in you mind, isn't that
easier to ramboot from bootable XPe CD? Then you won't need to mess up with
DOS/PXE environment.
If ramboot a SDI file from a bootable CD is an option for you, there is name
ways to do that. One is to use /rdpath switch from boot.ini. Search google
for more info on it.

KM
Our network infrastructure does not support PXE, however we would like to
boot devices that do not contain persistent storage. Could you help us get
an SDI Ramdisk image loading from DOS? According to the whitepaper, it
seems like a possible solution.
Concept:
1. Boot from DOS TCP/IP network boot disk, or DOS bootable CD.
2. Copy SDI image to RAM (from network share or local CD drive)
3. RAM boot

Saad, can you help me get started with coding steps 1 through 3 of your
whitepaper? Slobodan, it looked like you had some code working in other
threads. Can you share? I could really use some help. :)
 
G

Guest

I would like to include the BOOT, PART, and BLOB in the SDI so that the image can boot using the NTLDR, BOOT.INI, and NTDETECT.COM inside the SDI, not externally. This eliminates the assumption that the host has a compatible version of NTLDR, and additional entries in the BOOT.INI (i.e. RAMDISK(0))

Using the info in the threads for booting from El Torito or local hard disk assumes you are using an external NTLDR, BOOT.INI, and NTDETECT.COM, and that your SDI image only contains the PART section.

If someone (Slobodan / Saad) has assembly source that can successfully do all the steps in Saad's whitepaper (1-9), I would really appreciate it! :) Even if it is for a different OS loader, it would really help!

Regards,

Don
 
S

Slobodan Brcin

This is CD boot loader, USB loader is similar few lines different.

CD will boot only if num lock is disabled. You can remove this feature. It
is intended that when CD completes installation and reboots to make deployed
XPe execute by default.

offset 506 contains start, and end pos of image data on disk, expressed in
MB.
BTW. You can remove my ugly progress or modify it.


Regards,
Slobodan




;***************************************************************************
**
;******************************* PBR Loader
***********************************
;***************************** Slobodan Brcin 05.10.2003.
*************************
;***************************************************************************
**


SDIDestMem equ (1024*1024*64)


TITLE bootloader
..model small
..386P
..code

jmp start
db '3B-Elekt' ; BS_OEMName
dw 512 ; BPB_BytsPerSec ; OK
db 4 ; BPB_SecPerClus ; OK 2KB/Cluster
dw 1 ; BPB_RsvdSecCnt ; OK

db 1 ; BPB_NumFATs ; Non standard but for Flash OK
dw 512 ; BPB_RootEntCnt ; Recommended
dw 0 ; BPB_TotSec16 ; OK
db 0F8h ; BPB_Media ; Fixed ?????
dw 0FCh ; BPB_FATSz16
dw 32 ; BPB_SecPerTrk
dw 64 ; BPB_NumHeads
dd 0 ; BPB_HiddSec

dd 256*2048 ; BPB_TotSec32
db 80h ; BS_DrvNum ; HDD
db 00h ; BS_Reserved1
db 29h ; BS_BootSig
dd 06Eh ; BS_VolID
db '12345678901' ; BS_VolLab
db 'FAT16 ' ; BS_FilSysType

; --------------------------------------------------------------------------
--------------------
; ------------------------------------- RUN SDI Image
Begin ------------------------------------
; --------------------------------------------------------------------------
--------------------
RunXPE: cli
mov ax,30 ;
mov ss,ax ; Setup stack for boot code
mov esp,0100h ;
sti


mov ax, 02000h
mov es, ax

mov ax, 0
mov ds, ax

mov esi, 0FC00h
CodeCopy: mov eax, ds:[esi-8000h]
mov es:[si], eax
add si, 4
jnz CodeCopy

push 02000h
push 0fc00h + LabGo
retf ; Jump to 2000:FCxx

LabGo: mov edx, SDIDestMem
mov esi, edx
mov edi, 7C00h
call CopyMem
add esi, ds:[7c00h + 10h] ; BootCodeOffset
call CopyMem
add esi, 4000h
add edi, 4000h
call CopyMem
or dl,041h
push 0
push 07c00h
retf ; Jump to 0:7C00

; --------------------------------------------------------------------------
--------------------
; ------------------------------------- RUN SDI Image
End --------------------------------------
; --------------------------------------------------------------------------
--------------------


CopyMem: pushad
push es
mov ax, 5000h
mov es, ax
mov bp, 0
CopyMem1: mov word ptr es:[bp], 0
add bp, 2
cmp bp, 30h
jne CopyMem1
mov es:[12h], esi
mov es:[1Ah], edi
mov byte ptr es:[15h], 93h
mov byte ptr es:[1Dh], 93h
mov word ptr es:[10h], 32*512*2
mov word ptr es:[18h], 32*512*2
mov eax, esi
shr eax, 24
mov es:[17h], al
mov eax, edi
shr eax, 24
mov es:[1Fh], al
mov si, 0
mov cx, 32*512
mov ah, 87h
int 15h
pop es
popad
ret ; CF - Set on error


;AX - 0..1023 cylinder
;DH = head number
;DL = drive number (bit 7 set for hard disk)
;EDI = IO - Flat dest

LoadHead: pushad
push es
mov ch, al
mov cl, ah
shl cl, 6
or cl, 1
mov ax, 0200h + 32
mov bx, 1000h
mov es, bx
mov bx, 0
int 13h
jc LoadHead_E
mov esi, 10000h
call CopyMem
LoadHead_E: pop es
popad
ret ; CF - Set on error


;AX - 0..1023 cylinder
;DL = drive number (bit 7 set for hard disk)
;EDI = IO - Flat dest

LoadCyl: push dx
mov dh, 0
LoadCyl_1: call LoadHead
jc LoadCyl_E
inc dh
add edi, 32*512
cmp dh, 64
jne LoadCyl_1
clc
LoadCyl_E: pop dx
ret




start:

mov ah, 2
int 16h
and al, 20h
jz starting ; Num - lock off - starting
int 18h

starting:

mov ax, 0b800h
mov es, ax
mov di, 0
mov cx, 80*25
mov ax, 0
rep stosw

mov si, 160*24
mov edi, SDIDestMem
mov ax, cs:[7C00h+506]

l22: call LoadCyl
mov bh, 18h
mov bl, 'E'
jc errr
mov bl, 'O'
errr: mov es:[si], bx
errr2: jc errr2
add si, 2
inc ax
cmp ax, cs:[7C00h+508]
jne l22


jmp RunXPE




org 506
dw 1, 68
dw 0AA55h
END
Don Noonan said:
I would like to include the BOOT, PART, and BLOB in the SDI so that the
image can boot using the NTLDR, BOOT.INI, and NTDETECT.COM inside the SDI,
not externally. This eliminates the assumption that the host has a
compatible version of NTLDR, and additional entries in the BOOT.INI (i.e.
RAMDISK(0))
Using the info in the threads for booting from El Torito or local hard
disk assumes you are using an external NTLDR, BOOT.INI, and NTDETECT.COM,
and that your SDI image only contains the PART section.
If someone (Slobodan / Saad) has assembly source that can successfully do
all the steps in Saad's whitepaper (1-9), I would really appreciate it! :)
Even if it is for a different OS loader, it would really help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top