flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Assembly OS that will boot after burned into CD. Goto page 1, 2, 3 Next |
Author |
|
BAiC 28 Jul 2014, 07:09
first off this is an Operating System topic not Windows. secondly; good luck getting anyone here to do your homework for you .
_________________ byte me. |
|||
28 Jul 2014, 07:09 |
|
revolution 28 Jul 2014, 07:46
Moved to OS Construction.
|
|||
28 Jul 2014, 07:46 |
|
den010 28 Jul 2014, 08:33
Hi Guys I really need your Help!,
I'm completely newbie in Assembly Programming. I need to create an Assembly OS that will boot after burned into CD. Then after booting it should prompt and get input and have the user set the cursor size. I sounds easy but I'm completely newbie about it plz help me or I will fail my subject Smile. Guys please provide a code. Thank you _________________ I'm a Completely Newbie : Need help much |
|||
28 Jul 2014, 08:33 |
|
den010 28 Jul 2014, 08:45
This is the code i got so far. It's working however i need to give an option to the user to resize the cursor.
Code: mov ax, 9ch mov ss, ax mov sp, 4096d mov ax, 7c0h mov ds, ax ;================================ mov ah,09h mov cx,1000h mov al,20h mov bl, 17h int 10h mov ah,09h mov cx,80h mov al,20h mov bl, 87h int 10h mov ah,01h mov cx,07h int 10h mov bl,5h ;x mov cl,5h ;y _mouser: mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,00h int 16h cmp al,77h je _up cmp al,73h je _down cmp al,61h je _left cmp al,64h je _right jmp _mouser _up: cmp cl,0h je _mouser sub cl, 1h jmp _mouser _down: cmp cl,24d je _mouser add cl, 1h jmp _mouser _left: cmp bl,0h je _mouser sub bl, 1h jmp _mouser _right: cmp bl,79d je _mouser add bl, 1h jmp _mouser printstring: lodsb cmp al,24h je printstring_eof mov ah,0eh int 10h jmp printstring printstring_eof: ret msg db 'Hello,World!$' ;================================ times 510-($-$$) db 0 dw 0xAA55 I hope you could help me guys. thanks a lot. Edit by revolution: Added code tags |
|||
28 Jul 2014, 08:45 |
|
smiddy 29 Jul 2014, 01:36
It looks like you are on your way. Look at all the INT 10h functions from BIOS.
|
|||
29 Jul 2014, 01:36 |
|
den010 30 Jul 2014, 00:30
Thank you for your kindest reply.
I finally able to make my OS run, move my cursor around and prompt user to set the cursor size. This is the code: Code: mov ax, 9ch mov ss, ax mov sp, 4096d mov ax, 7c0h mov ds, ax ;================================ mov ah,09h mov cx,1000h mov al,20h mov bl, 0dfh int 10h mov ah,09h mov cx,50h mov al,20h mov bl, 50h int 10h ;============================================ mov ah,0eh mov al,53h int 10h ;===t mov ah,0eh mov al,74h int 10h ;===e mov ah,0eh mov al,65h int 10h ;===f mov ah,0eh mov al,66h int 10h ;===' mov ah,0eh mov al,27h int 10h ;===s mov ah,0eh mov al,73h int 10h ;===(space) mov ah,0eh mov al,20h int 10h ;===o mov ah,0eh mov al,4fh int 10h ;===s mov ah,0eh mov al,53h int 10h mov ah,01h mov cx,0bh int 10h mov bl,00h ;x mov cl,03h ;y mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,0eh mov al,52h ;R int 10h mov ah,0eh mov al,65h ;e int 10h mov ah,0eh mov al,73h ;s int 10h mov ah,0eh mov al,69h ;i int 10h mov ah,0eh mov al,7ah ;z int 10h mov ah,0eh mov al,65h ;e int 10h mov ah,0eh mov al,20h ;space int 10h mov ah,0eh mov al,63h ;c int 10h mov ah,0eh mov al,75h ;u int 10h mov ah,0eh mov al,72h ;r int 10h mov ah,0eh mov al,73h ;s int 10h mov ah,0eh mov al,6fh ;o int 10h mov ah,0eh mov al,72h ;r int 10h mov ah,0eh mov al,3fh ;? int 10h mov ah,0eh mov al,5bh ;[ int 10h mov ah,0eh mov al,79h ;y int 10h mov ah,0eh mov al,2fh ;/ int 10h mov ah,0eh mov al,6eh ;n int 10h mov ah,0eh mov al,5dh ;] int 10h mov ah,0eh mov al,3ah ;: int 10h mov ah,0eh mov al,20h ;space int 10h mov bl,00h ;x mov cl,05h ;y mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,0eh mov al,30h ;0 int 10h mov ah,0eh mov al,2dh ;- int 10h mov ah,0eh mov al,37h ;7 int 10h mov ah,0eh mov al,3ah ;: int 10h mov ah,0eh mov al,20h ;space int 10h ;====================================== mov ah,01h mov cx,0bh int 10h mov bl,29h ;x mov cl,0Ah ;y mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,00h int 16h cmp al,79h ;yes je _mouser cmp al,6eh ;no je _out _mouser: mov bl,14h ;x mov cl,03h ;y mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,0eh mov al,59h int 10h accept: mov bl,29h ;x mov cl,0Ah ;y mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,00h int 16h check1: cmp al,37h jg accept cmp al,30h jl accept jmp next next: cmp al,30h je do1 next1: cmp al,31h je do2 next2: cmp al,32h je do3 next3: cmp al,33h je do4 next4: cmp al,34h je do5 next5: cmp al,35h je do6 next6: cmp al,36h je do7 next7: cmp al,37h je do8 do1: mov ah,01h mov cx,00h int 10h jmp accept do2: mov ah,01h mov cx,01h int 10h jmp accept do3: mov ah,01h mov cx,02h int 10h jmp accept do4: mov ah,01h mov cx,03h int 10h jmp accept do5: mov ah,01h mov cx,04h int 10h jmp accept do6: mov ah,01h mov cx,05h int 10h jmp accept do7: mov ah,01h mov cx,06h int 10h jmp accept do8: mov ah,01h mov cx,07h int 10h jmp accept _out: mov bl,14h ;x mov cl,03h ;y mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,0eh mov al,4eh int 10h mov bl,29h ;x mov cl,0ah ;y mov ah,02h mov dl,bl mov dh,cl int 10h mov ah,0eh mov al,42h int 10h mov ah,0eh mov al,79h int 10h mov ah,0eh mov al,65h int 10h times 510-($-$$) db 0 dw 0xAA55 Now I need to burn it into a CD and have it bootable, like burning a Windows OS to CD. Can someone help me do it? I need to burn this into a CD. After burning into the CD it would boot up the program when click by the user. Edit by revolution: Added code tags _________________ I'm a Completely Newbie : Need help much |
|||
30 Jul 2014, 00:30 |
|
smiddy 30 Jul 2014, 02:25
Look for MagicISO, you can emulate a floppy with this code.
|
|||
30 Jul 2014, 02:25 |
|
den010 30 Jul 2014, 09:38
how do I use magicISO for this? Is it ok to provide me some intructions? I hope im not asking to much thank you
_________________ I'm a Completely Newbie : Need help much |
|||
30 Jul 2014, 09:38 |
|
smiddy 30 Jul 2014, 11:33
I could, but then you will only learn how to do one thing. You need to read up on boot loaders for x86 platform, then try to implement what you've read/learned via MagicISO. There is specific terminology you have to assimilate before you learn what you are about to do. Copying one's procedure only shows you the procedure. Learning the aspects of things such that you can cognitively adjust to what is there and apply it, now that's entirely different and why you're in school. This is going to take some effort on your part.
I have led you to water, now drink! |
|||
30 Jul 2014, 11:33 |
|
badc0de02 30 Jul 2014, 18:15
lol your code is a messssss
ok. you can use freedos what autorun your mess as .com file install it and boot via grub http://www.agent31.eu/2008/12/booting-freedos-with-grub.html or you can only install freedos image to you cd with the cool os on it or you can install with out dos then you have to create you own bootloader with you hands simply (revolution's edits suck!!!) |
|||
30 Jul 2014, 18:15 |
|
den010 02 Aug 2014, 20:47
Sigh, thanks for the replies anyways.
I did tried looking over in the internet in every way possible but not lucky enough. How come other posts can actually get a good replies with code's working for them. I envy those lucky people. I'm giving up and just shift course. I will just fail my in class anyway. GOod bye programming. I'll forget IT field and figure out what my real forte is I guess. _________________ I'm a Completely Newbie : Need help much |
|||
02 Aug 2014, 20:47 |
|
den010 02 Aug 2014, 21:22
I didn't give up yet.
I finally managed to create an ISO file from my code: mkisofs -R -b floppy.img -no-emul-boot -boot-load-size 4 -boot-info-table -o bootable.iso cdcontents. However when I tried it in virtual box select storage then add an IDE controller then add the boot.iso it was not successful booted. It's showing this error: fatal: could not read from the boot medium! system halted. Do I need to change a code in my FASM? Or is img file that I converted into an ISO file should work when run in VirtualBOX? Please I'm so close any ideas? smiddy? badc0de02? |
|||
02 Aug 2014, 21:22 |
|
BAiC 03 Aug 2014, 01:50
first of all; homework doesn't exist to be a challenge. it exists to be an exercise. your problem isn't focused on anything specific so it's difficult for anyone to help without understanding what your instructor was trying to teach you. thats why I don't help with homework.
second; VirtualBox requires the boot signature at the end of the entire image when dealing with a floppy image (this isn't true about actual hardware or VMware) so maybe it's that. -Stefan _________________ byte me. |
|||
03 Aug 2014, 01:50 |
|
den010 03 Aug 2014, 03:43
Thanks for your reply, and the scolding part. , I'm sure my professor doesn't know how to do it himself. He just know how to throw problems to his students do this do that. In the end he'll not even show his coding himself. He just read his agenda for the day and no learning at all.
I understand but can you at least give a guide or tips on how to do it? Or point out what I'm doing wrong? _________________ I'm a Completely Newbie : Need help much |
|||
03 Aug 2014, 03:43 |
|
den010 03 Aug 2014, 03:56
Wohooo thank you for the hint. I finally made it work in Virtual Box.
I hope it will work after I burn it into a CD. |
|||
03 Aug 2014, 03:56 |
|
den010 03 Aug 2014, 04:21
I thought I finally made it . I was wrong I forgot to remove the floppy controller that has the floppy.img which made it boot and show the interface.
sigh.. its frustrating. Anyone? my code works if I attached it in a floppy controller in Virtualbox but it won't work if attached into IDE controller for CD. Anyone? Who can make my code run when burned into a CD? Or is it even possible? I think im doing the impossible. |
|||
03 Aug 2014, 04:21 |
|
BAiC 03 Aug 2014, 05:06
FYI: the code is typcally different between boot devices. the Floppy has effectively the same interface (to the BIOS) as the Floppy (CHS) so they're very similar. I don't boot from CD so I can't speak to it. that said, I'm pretty sure anything but floppy emulation will require a rewrite of the code.
- Stefan BTW: you really should use loops in your code ("Resize Cursor", for one, belongs in a loop). |
|||
03 Aug 2014, 05:06 |
|
BAiC 03 Aug 2014, 05:25
this is one type of loop:
Code: struc string text { local end .: db end-$ db text end=$ } xor ax, ax mov ds, ax mov si, str lodsb movzx cx, al @@: mov ah,0eh lodsb push cx si ds int 10h pop ds si cx loop @b ; . ; . code here. which ends before the data. ; . str string "text here" -Stefan _________________ byte me. |
|||
03 Aug 2014, 05:25 |
|
sinsi 03 Aug 2014, 06:21
If you are using no emulation, the boot sector (2048 bytes, not 512) is usually loaded at 1000:0000, not 7c0:0000.
|
|||
03 Aug 2014, 06:21 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.