flat assembler
Message board for the users of flat assembler.

Index > OS Construction > .

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
mikegonta



Joined: 20 Nov 2005
Posts: 99
mikegonta
[ Post removed by author. ]


Last edited by mikegonta on 28 Jan 2009, 09:01; edited 13 times in total
Post 20 Nov 2005, 22:22
View user's profile Send private message Reply with quote
mikegonta



Joined: 20 Nov 2005
Posts: 99
mikegonta
[ Post removed by author. ]


Last edited by mikegonta on 17 Oct 2008, 15:49; edited 2 times in total
Post 21 Nov 2005, 23:53
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16942
Location: In your JS exploiting you and your system
revolution
Thanks for the info mikegonta. Very useful.
Post 22 Nov 2005, 01:48
View user's profile Send private message Visit poster's website Reply with quote
mikegonta



Joined: 20 Nov 2005
Posts: 99
mikegonta
[ Post removed by author. ]


Last edited by mikegonta on 17 Oct 2008, 15:50; edited 1 time in total
Post 23 Nov 2005, 03:07
View user's profile Send private message Reply with quote
MarcoAlves



Joined: 09 Jun 2006
Posts: 30
MarcoAlves
mikegonta, your tool is VERY VERY NICE. Congratulations man.

But, I've just one question:

How I can put other files into the bootable image file? like a picture, a txt file, etc etc, i.e., the needed files to start my os setup, like windows xp cd setup.

I'm using VMWare. I had tested your tool with it and all works fine. My
bootloader was loaded by VMWare, after compiling my code with your
tool.

Best Regards,
Marco Alves.
Post 14 Jun 2006, 21:04
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7108
Location: Slovakia
vid
very nice, thanks.

should go to interesting threads/OSdev
Post 14 Jun 2006, 21:14
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
I can not see the point, how is it simpler that having a floppy or Hdd image and clicking on the "make bootable" in your burn software ?.
The above method does use emulation of floppy or hdd and emulation stops up on entering pmode.

But if you go back to realmode to use int 13h, emulation starts again, and it no slower than a pmode floppy or hdd driver, that why i have two floppy and hdd drivers, theres big advantages in using int 13h by going back and forth, eg: read/write USB pen drives, and being able to load from CD, under emulation.

NOTE: I am not ? the code, but rather the mefod, being simpler Wink
Post 14 Jun 2006, 22:11
View user's profile Send private message Reply with quote
MarcoAlves



Joined: 09 Jun 2006
Posts: 30
MarcoAlves
Dex4u wrote:
I can not see the point, how is it simpler that having a floppy or Hdd image and clicking on the "make bootable" in your burn software ?.
The above method does use emulation of floppy or hdd and emulation stops up on entering pmode.

But if you go back to realmode to use int 13h, emulation starts again, and it no slower than a pmode floppy or hdd driver, that why i have two floppy and hdd drivers, theres big advantages in using int 13h by going back and forth, eg: read/write USB pen drives, and being able to load from CD, under emulation.

NOTE: I am not ? the code, but rather the mefod, being simpler Wink


I'm noob. But, I think that this tool is useful for me because I've a notebook
and it doesn't has a floppy drive. If you have other suggestions and
how I can put the files into a image file and load them in VMWare, I will
appreciate.

Best Regards,
Marco Alves.
Post 19 Jun 2006, 13:06
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
First i want to make it clear that its a nice and usefull peace of code, i was just pointing that making a bootable cd is esaier by using burn software.
Now to answer you ?, although i have not used this mefod my self (as i have a floppy drive), from my understanding, you can with this tool (the free ver)
http://ourworld.compuserve.com/homepages/gvollant/download.htm
To inject files and directories into an existing disk image, that mean you just need to down load some floppy image and take out there file and inject yours.

Hope this helps.
Post 19 Jun 2006, 14:36
View user's profile Send private message Reply with quote
MarcoAlves



Joined: 09 Jun 2006
Posts: 30
MarcoAlves
I'd downloaded the software but it can't open the bin file generated with
the tool coded by mikegonta. Can you help-me?

Dex4u, a simple question: Suppose that I can put the files into the cd.
How I can read those files from my asm app? Is this like reading from
hd?

THX IN ADVANCE.

Best Regards,
Marco Alves.
Post 20 Jun 2006, 13:14
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Heres the basic way it works, if you put a floppy image or hdd image on to a cd by clicking the make bootable option.
Up on booting, it emulates the floppy or hdd so you A: drive is the floppy image on the cd and your real floppy drive (if you have 1) is your b: drive, as long as your OS code stays in realmode this is how it will work, but if you go to pmode emulation stops or there is a int that can stop emulation in realmode.

So to load program from the floppy image on the cd you can go to unreal mode and load the floppy image into a ramdisk like menuet does or you can go back to realmode use int 13h and read a: drive (as soon as you go back emulation starts again, unless you have done the int to stop it.
If you want to put other stuff on the cd, other than whats in the images, you need to make a ATAPI driver.

If you want i have a ATAPI driver for my OS written in fasm you can look at, if you decide to write one.

NOTE: If for example your bootloader normally users the floppy to load your kernel in realmode using int 13h, this will work just the same from the floppy image on the cd.
Post 20 Jun 2006, 15:49
View user's profile Send private message Reply with quote
kdownload



Joined: 31 Oct 2008
Posts: 18
kdownload
I seem to be having trouble getting this to work for me. I can't even try jmp 0:0 afterwords and cause a triple fault. Can anyone who got this to work post some working code?
Post 02 Dec 2008, 01:30
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386
WARNING: > 2 years old thread bumped by kdownload

> I can't even try jmp 0:0 afterwords and cause a triple fault. Can anyone who got this to work post some working code?

What did you expect ? "jmp 0:0" is a secure GPF in PM and nonsense in RM (you have the IVT at 0:0)
Post 02 Dec 2008, 06:13
View user's profile Send private message Reply with quote
kdownload



Joined: 31 Oct 2008
Posts: 18
kdownload
DOS386 wrote:
WARNING: > 2 years old thread bumped by kdownload


2 year old thread recently modified and happens to be the only topic here that supports.

Quote:
What did you expect ? "jmp 0:0" is a secure GPF in PM and nonsense in RM (you have the IVT at 0:0)


Ok, let's see you try doing something else with it then. I can't get it to print "hello" either. Reading above it clearly worked at one point, trying to find out why it's not working for me.
Post 02 Dec 2008, 09:44
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
kdownload,

Beware, for "No emulation" media type "load segment" from El Torito boot catalog is the segment (i.e. for load segment 07C0 your code will start with cs:ip==07C0:0000, not 0000:7C00 as you may expect). With 1.44 FD emulation it is 0000:7C00 no matter which load segment I supplied in boot catalog entry (at least for my BIOS — your mileage may vary; it appears that BIOS starts FD emulation and boots from this emulated floppy as usual).
Post 02 Dec 2008, 13:33
View user's profile Send private message Reply with quote
kdownload



Joined: 31 Oct 2008
Posts: 18
kdownload
Doesn't solve my problem, but that does help a bit... I was wondering why it was even there at all, considering everything else i've delt with boots from 0x7c00 (even PXE). Do you have anything i can run? It'd be a big help, because aside from this thing here that i can't get any output from, i'm comparing output files in a hex editor with an existing no-emulation cd booting thing. This wacky standard has me constantly scratching my head, whether it be the ambiguity of the ISO 9660 standard or the fact that the el torito specification uses hex numbers throughout that whole document.
Post 02 Dec 2008, 18:25
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
kdownload,

You may try this:
Code:
        call    @f
        db      "Hello, world!", 13, 10, 0
@@:     pop     si
        mov     ah, 0x0F
@@:     int     0x10
        mov     ah, 0x0E
        lods    byte [cs:si]
        test    al, al
        jnz     @b
        xor     ah, ah
        int     0x16
        int     0x19    
Or see attached source, that program dumps registers at startup.


Description: Startup dump program
Download
Filename: BootStat.fasm.Zip
Filesize: 2.21 KB
Downloaded: 196 Time(s)


_________________
"Don't belong. Never join. Think for yourself. Peace." – Victor Stone.
Post 02 Dec 2008, 23:42
View user's profile Send private message Reply with quote
kdownload



Joined: 31 Oct 2008
Posts: 18
kdownload
Still doesn't work... not so new to OSDevelopment, but this ISO thing has my head spinnin'. Good luck to anyone who can make the following peice of code work.

Code:
macro msb_dw x { dw ((x and 0FF00h) shr 8) or ((x and 0FFh) shl 8) }

macro lb_dw x {
  dw x
  msb_dw x }

macro msb_dd x {
  dd ((x and 0FF000000h) shr 24) or ((x and 0FF0000h) shr 8) or \
  ((x and 0FF00h) shl 8) or ((x and 0FFh) shl 24) }

macro lb_dd x {
  dd x
  msb_dd x }

macro binary_date year, month, day, hour, minute, second, offset {
  db year-1900, month, day, hour, minute, second, offset }

macro text_date year, month, day, hour, minute, second, hundredth, offset {
  db year, month, day, hour, minute, second, hundredth, offset }

Bootable_CD:
Read_Me:
  db "This is an ISO9660/Joliet bootable cdrom image.",0Dh,0Ah
  db "Released to the Public Domain 2005, Mike Gonta",0Dh,0Ah
  .Read_Me:
  times 2048*9-($-Read_Me) db 0

BootCat.Bin:
  .Validation_Entry:
    .Header_ID: db 1
    .Platform_ID: db 0
    dw 0
    .ID_String: db ""
      times 24 db 0
    .Checksum_Word: db 0AAh, 55h
    .Signature db 55h, 0AAh
  .Default_Entry:
    .Boot_Indicator: db 88h
    .Boot_Media_Type: db 0               ; no emulation
    .Load_Segment: dw 0                  ; the bios will load at 7C0:0 or 0:7c00
    .System_Type: db 0
    db 0
    .Virtual_Sector_Count: dw 4          ; one CD sector
    .Load_RBA: dd (Boot_Sector-Bootable_CD)/2048
  times 2048-($-BootCat.Bin) db 0

Primary_Directory_Records:
  Primary_1:
    .size: db 34
    .extended_attribute: db 0
    .location: lb_dd ((Primary_Directory_Records-Bootable_CD)/2048)
    .data_length: lb_dd 2048
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 2
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db 1
    .file_identifier: db 0
  Primary_2:
    .size: db 34
    .extended_attribute: db 0
    .location: lb_dd ((Primary_Directory_Records-Bootable_CD)/2048)
    .data_length: lb_dd 2048
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 2
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db 1
    .file_identifier: db 1
  Primary_Readme:
    .size: db .Primary_Readme-Primary_Readme
    .extended_attribute: db 0
    .location: lb_dd ((Read_Me-Bootable_CD)/2048)
    .data_length: lb_dd (Read_Me.Read_Me-Read_Me)
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 0
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db .Primary_Readme-.file_identifier
    .file_identifier: db "README.TXT",59,49
    .Primary_Readme:
  times 2048-($-Primary_Directory_Records) db 0

Primary_Type_L_Path_Table:
  .size: db 1
  .extended_attribute: db 0
  .extent_location: dd ((Primary_Directory_Records-Bootable_CD)/2048)
  .parent_directory: dw 1
  .directory_identifier: dw 0
  times 2048-($-Primary_Type_L_Path_Table) db 0

Primary_Type_M_Path_Table:
  .size: db 1
  .extended_attribute: db 0
  .extent_location: msb_dd ((Primary_Directory_Records-Bootable_CD)/2048)
  .parent_directory: msb_dw 1
  .directory_identifier: msb_dw 0
  times 2048-($-Primary_Type_M_Path_Table) db 0

Supplementary_Directory_Records:
  Supplementary_1:
    .size: db 34
    .extended_attribute: db 0
    .location: lb_dd ((Supplementary_Directory_Records-Bootable_CD)/2048)
    .data_length: lb_dd 2048
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 2
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db 1
    .file_identifier: db 0
  Supplementary_2:
    .size: db 34
    .extended_attribute: db 0
    .location: lb_dd ((Supplementary_Directory_Records-Bootable_CD)/2048)
    .data_length: lb_dd 2048
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 2
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db 1
    .file_identifier: db 1
  Supplementary_Readme:
    .size: db .Supplementary_Readme-Supplementary_Readme
    .extended_attribute: db 0
    .location: lb_dd ((Read_Me-Bootable_CD)/2048)
    .data_length: lb_dd (Read_Me.Read_Me-Read_Me)
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 0
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db .Supplementary_Readme-.file_identifier
    .file_identifier:
      db 0,"R",0,"e",0,"a",0,"d",0," ",0,"m",0,"e",0,".",0,"t",0,"x",0,"t"
      db 0,59,0,49
    .Supplementary_Readme:
  times 2048-($-Supplementary_Directory_Records) db 0

Supplementary_Type_L_Path_Table:
  .size: db 1
  .extended_attribute: db 0
  .extent_location: dd ((Supplementary_Directory_Records-Bootable_CD)/2048)
  .parent_directory: dw 1
  .directory_identifier: dw 0
  times 2048-($-Supplementary_Type_L_Path_Table) db 0

Supplementary_Type_M_Path_Table:
  .size: db 1
  .extended_attribute: db 0
  .extent_location: msb_dd ((Supplementary_Directory_Records-Bootable_CD)/2048)
  .parent_directory: msb_dw 1
  .directory_identifier: msb_dw 0
  times 2048-($-Supplementary_Type_M_Path_Table) db 0

Primary_Volume_Descriptor:
  .Volume_Descriptor_Type: db 1
  .Standard_Identifier: db "CD001"
  .Volume_Descriptor_Version: db 1
  .Volume_Flags db 0
  .System_Identifier:
    times 32-($-.System_Identifier) db " "
  .Volume_Identifier: db "BOOTABLE_CD"
    times 32-($-.Volume_Identifier) db " "
  times 8 db 0
  .Volume_Space_Size: lb_dd ((Boot_Sector-Bootable_CD)/2048)
  times 32 db 0
  .Volume_Set_Size: lb_dw 1
  .Volume_Sequence_Number: lb_dw 1
  .Logical_Block_Size: lb_dw 2048
  .Path_Table_Size: lb_dd 10
  .Type_L_Path_Table: dd ((Primary_Type_L_Path_Table-Bootable_CD)/2048)
  .Optional_Type_L_Path_Table: dd 0
  .Type_M_Path_Table: msb_dd ((Primary_Type_M_Path_Table-Bootable_CD)/2048)
  .Optional_Type_M_Path_Table: msb_dd 0
  .Root_Directory_Record:
    .size: db 34
    .extended_attribute: db 0
    .location: lb_dd ((Primary_Directory_Records-Bootable_CD)/2048)
    .data_length: lb_dd 2048
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 2
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db 1
    .file_identifier: db 0
  .Volume_Set_Identifier:
    times 128-($-.Volume_Set_Identifier) db " "
  .Publisher_Identifier:
    times 128-($-.Publisher_Identifier) db " "
  .Data_Preparer_Identifier:
    times 128-($-.Data_Preparer_Identifier) db " "
  .Application_Identifier:
    times 128-($-.Application_Identifier) db " "
  .Copyright_File_Identifier:
    times 37-($-.Copyright_File_Identifier) db " "
  .Abstract_File_Identifier:
    times 37-($-.Abstract_File_Identifier) db " "
  .Bibliographic_File_Identifier:
    times 37-($-.Bibliographic_File_Identifier) db " "
  Primary_Volume_Creation_Date_and_Time:
    text_date "2005", "01", "01", "00", "00", "00", "00", 0
  Primary_Volume_Modification_Date_and_Time:
    text_date "2005", "01", "01", "00", "00", "00", "00", 0
  .Volume_Expiration_Date_and_Time:
    times 17 db 0
  .Volume_Effective_Date_and_Time:
    times 17 db 0
  .File_Structure_Version: db 1
  times 2048-($-Primary_Volume_Descriptor) db 0

Boot_Record_Descriptor:
  .Volume_Descriptor_Type: db 0
  .Standard_Identifier: db "CD001"
  .Volume_Descriptor_Version: db 1
  .Boot_System_Identifier: db "EL TORITO SPECIFICATION"
    times 64-($-.Boot_System_Identifier) db 0
  .Boot_Catalog_Sector: dd (BootCat.Bin-Bootable_CD)/2048
  times 2048-($-Boot_Record_Descriptor) db 0

Supplementary_Volume_Descriptor:
  .Volume_Descriptor_Type: db 2
  .Standard_Identifier: db "CD001"
  .Volume_Descriptor_Version: db 1
  .Volume_Flags db 0
  .System_Identifier:
    times 32-($-.System_Identifier) db 0
  .Volume_Identifier:
    db 0,"B",0,"o",0,"o",0,"t",0,"a",0,"b",0,"l",0,"e",0," ",0,"C",0,"D"
    times 32-($-.Volume_Identifier) db 0
  times 8 db 0
  .Volume_Space_Size: lb_dd ((Boot_Sector-Bootable_CD)/2048)
  .Escape_Sequence: db 37, 47, 69
    times 32-($-.Escape_Sequence) db 0
  .Volume_Set_Size: lb_dw 1
  .Volume_Sequence_Number: lb_dw 1
  .Logical_Block_Size: lb_dw 2048
  .Path_Table_Size: lb_dd 10
  .Type_L_Path_Table: dd ((Supplementary_Type_L_Path_Table-Bootable_CD)/2048)
  .Optional_Type_L_Path_Table: dd 0
  .Type_M_Path_Table: msb_dd ((Supplementary_Type_M_Path_Table-Bootable_CD)/2048)
  .Optional_Type_M_Path_Table: msb_dd 0
  .Root_Directory_Record:
    .size: db 34
    .extended_attribute: db 0
    .location: lb_dd ((Supplementary_Directory_Records-Bootable_CD)/2048)
    .data_length: lb_dd 2048
    binary_date 2005, 1, 1, 0, 0, 0, 0
    .file_flags: db 2
    .file_unit_size: db 0
    .interleave_gap_size: db 0
    .volume_sequence_number: lb_dw 0
    .length_of_file_identifier: db 1
    .file_identifier: db 0
  .Volume_Set_Identifier:
    times 128-($-.Volume_Set_Identifier) db 0
  .Publisher_Identifier:
    times 128-($-.Publisher_Identifier) db 0
  .Data_Preparer_Identifier:
    times 128-($-.Data_Preparer_Identifier) db 0
  .Application_Identifier:
    times 128-($-.Application_Identifier) db 0
  .Copyright_File_Identifier:
    times 37-($-.Copyright_File_Identifier) db 0
  .Abstract_File_Identifier:
    times 37-($-.Abstract_File_Identifier) db 0
  .Bibliographic_File_Identifier:
    times 37-($-.Bibliographic_File_Identifier) db 0
  Supplementary_Volume_Creation_Date_and_Time:
    text_date "2005", "01", "01", "00", "00", "00", "00", 0
  Supplementary_Volume_Modification_Date_and_Time:
    text_date "2005", "01", "01", "00", "00", "00", "00", 0
  .Volume_Expiration_Date_and_Time:
    times 17 db 0
  .Volume_Effective_Date_and_Time:
    times 17 db 0
  .File_Structure_Version: db 1
  times 2048-($-Supplementary_Volume_Descriptor) db 0

Terminator_Volume_Descriptor:
  .Volume_Descriptor_Type: db 255
  .Standard_Identifier: db "CD001"
  .Volume_Descriptor_Version: db 1
  times 2048-($-Terminator_Volume_Descriptor) db 0

Boot_Sector:
;  org 7C00h ;Doesn't really boot here?

        call    @f
        db      "Hello, world!", 13, 10, 0
@@:     pop     si
        mov     ah, 0x0F
@@:     int     0x10
        mov     ah, 0x0E
        lods    byte [cs:si]
        test    al, al
        jnz     @b
        xor     ah, ah
        int     0x16
        int     0x19
    mov     cx, 0
       div cx        ;No crash, no triple fault, no error, nothing X(    
Post 03 Dec 2008, 00:40
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
kdownload,

Strange, I'd just compiled your source, burnt image and it works as expected (i.e. displays "Hello, world!", waits for keypress, return to BIOS via int 19). Your mov cx, 0/div cx is unreachable, didn't you notice?

By the way, which program are you using to burn CD, and how?
Post 03 Dec 2008, 08:29
View user's profile Send private message Reply with quote
mikegonta



Joined: 20 Nov 2005
Posts: 99
mikegonta
[ Post removed by author. ]


Last edited by mikegonta on 28 Jan 2009, 09:02; edited 1 time in total
Post 03 Dec 2008, 22:15
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.