Patricknet Grub Help

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Patricknet Grub Help

Post by PatrickV »

Hi!
I've been trying to code my own filing and bootloader which i failed and cann't be bothered anymore with keep formating floppy disks after time and time. I want to be able to make my os a general use os like ubuntu. I had a look at grub for starters and i don't think i can make it work after with a simple string of text which I looked at the osdev wiki and i find it very hard to impalemt and understand. Plus i work with windows and also i need to make floppy images becasue it is so easy for people to test and everyone is asking for them.Not many people use actual hardware far as i experence being here. Can you guys help me out. I also uploaded my code to see if it fits the "/boot/kernal.bin" grub standards. I want to try a new approch of using grub. So i need all the help i need. The tutorial in wiki is not clear? so many question? For 1 how do make a axliary disk. It doesn't tell you any thing that you are start from starch

Code: Select all

;Patricknet Bootsector
;Built By Patrick V(Project Manager)
;Bootsector is opensource

[bits 16]
[org 0x7c00]
jmp Start
; Message Strap
msg		db "Patricknet - Version: Beta 0.2 (15/9/2008)",13,10,0
Start:
	xor ax,ax
	cli
	mov ss,ax
	mov sp,0x7C00
	sti
		
	mov si,msg               
	call printdriver


printdriver:     
	mov ah,0x0E
	mov bh,0x00
	mov bx,0x07
	printdriverloop:
		lodsb
		or al,al
		jz short printdriverend
		int 0x10
		jmp printdriverloop
printdriverend:    
	jmp printdriverend		; return to caller

padding     TIMEs 510-($-$$) db 0
;Flag Point Form Bios To Notice That This A Patricknet Boot Sector Is Vaild By Signature
Dw 0AA55h

User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Re: Patricknet Grub Help

Post by inflater »

You can't specify [bits 16] in your kernel because GRUB will switch to pmode upon loading. You need to shut off pmode (before that, relocation to 640K) if you want something in real mode, or just pmode remember you cant use the BIOS ints there.

GRUB sucks royally, even its name tells so. If you are working on a floppy or floppy image, I suggest BootProg or bootr01 , or if you want to start directly with pmode, Bootf02. You'll find everything on osdever.net or google.
Its much simpler and you'll have your kernel up and running very fast, as GRUB needs to load its fatass second stage, which you don't want (if you do not want to boot your kernel from various partitions with various file systems...)
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
PatrickV
Member
Member
Posts: 151
Joined: Sun Jul 06, 2008 7:50 pm
Location: New Zealand
Contact:

Re: Patricknet Grub Help

Post by PatrickV »

Thanks for that inflater. You help me out a lot. But Is Bootprog, bootr01 and, bootr02 open source as grub is? I like stay on the right side of os developing and not treading on anyone's toes. :?:
Last edited by PatrickV on Wed Oct 08, 2008 5:58 pm, edited 1 time in total.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Patricknet Grub Help

Post by 01000101 »

bootf02.zip: READ.ME wrote: read.me for bootf02.zip

Version 2.0, May 1, 1999

Sample code

by John S. Fine [email protected]

I do not place any restrictions on your use of this source code

I do not provide any warranty of the correctness of this source code
bootr01.zip: READ.ME wrote: bootr01.zip Example real mode bootsectors

Version 1, Jul 5, 1999

Sample code

by John S. Fine [email protected]

I do not place any restrictions on your use of this source code

I do not provide any warranty of the correctness of this source code
bootprog.zip: BOOT16.ASM wrote: "BootProg" Loader v 1.2 by Alexei A. Frounze (c) 2000
Maybe a little research/googling would have clarified?

The BootProg does not specify in the READ.ME about its usage rights, and seeing as how the 'copyright' is from 2000 (and probably non-existent), it is hard to say.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Patricknet Grub Help

Post by Brynet-Inc »

01000101 wrote:The BootProg does not specify in the READ.ME about its usage rights, and seeing as how the 'copyright' is from 2000 (and probably non-existent), it is hard to say.
Alex is a frequent poster on alt.os.development... his copyright most definitely exists, regardless of the date mentioned in the file.

Your complete ignorance of copyright law is going to get you into trouble one day. ;)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Re: Patricknet Grub Help

Post by inflater »

01000101 wrote:The BootProg does not specify in the READ.ME about its usage rights, and seeing as how the 'copyright' is from 2000 (and probably non-existent), it is hard to say.
Many OSdevers are using his loader, including me, and I think its not harmful to use and modify his code. And no, you will not "tread someone's toes" for it...
Brynet-Inc wrote:Your complete ignorance of copyright law is going to get you into trouble one day
Ah yes, the US. Here, things are completely different, hehe... :twisted: (j/k. Almost the same, but nobody cares while it's nice and quiet... lol)
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Patricknet Grub Help

Post by 01000101 »

I was implying that it should not be used as public domain as it had a copyright, but that the actual status is unknown (by myself). Also, there are a lot of people out there that claim to have copyrighted material that dont, I consider it still copyrighted as it keeps things on the safe side, but still.
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Patricknet Grub Help

Post by egos »

Do you want to make the floppy image with GRUB? Here is the example how to do this by using fasm:

Code: Select all

; include "getsum.inc"
include "mkfloppy.inc"

file "content/boot/grub/stage1", 3
db "MKFLOPPY"
dw 512
db 1
dw 1
db 2
dw 14*512/32
dw 2*80*18
db 0F0h
dw 9
dw 18
dw 2
dd 0
dd 0
db 0
db 0
db 29h
dd 55555555h
db "BOOTABLEDEV"
db "FAT12", 32, 32, 32
file "content/boot/grub/stage1": $, 512-$

; store byte 0 at 40h ; boot_drive cell for GRUB 1.90
store dword stage2_base/512 at 44h ; kernel_sector cell for GRUB 1.90

; fat1
db 0F0h, 0FFh, 0FFh, 9*512-3 dup 0

; fat2
db 0F0h, 0FFh, 0FFh, 9*512-3 dup 0

; root
dent boot, "BOOT", FA_DIR
; ...
rb 33*512-$

defdir boot
{
dent grub, "GRUB", FA_DIR
}

defdir grub
{
; getsum "FAT_ST~1"
; db 41h, "f", 0, "a", 0, "t", 0, "_", 0, "s", 0, 0Fh, 0, sum, "t", 0 ; LFN for "fat_stage1_5"
; db "a", 0, "g", 0, "e", 0, "1", 0, "_", 0, 0, 0, "5", 0, 0, 0
; dent fatstage, "FAT_ST~1", FA_ARC
dent menu, "MENU    LST", FA_ARC
dent stage2, "STAGE2", FA_ARC
}

; data
stod boot, root
stod grub, boot
; stof fatstage, "content/boot/grub/fat_stage1_5"
stof menu, "content/boot/grub/menu.lst"
stof stage2, "content/boot/grub/stage2"
store dword stage2_base/512+1 at stage2_base+1F8h
; ...
rb 2*80*18*512-$
Last edited by egos on Tue Oct 14, 2008 7:53 am, edited 1 time in total.
If you have seen bad English in my words, tell me what's wrong, please.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: Patricknet Grub Help

Post by AJ »

I would suggest using labels for each of the BPB fields. This means that you can use the BPB fields later in your code for CHS addressing and stops the BPB fields seeming so much like "Magic Numbers".

Cheers,
Adam
egos
Member
Member
Posts: 612
Joined: Fri Nov 16, 2007 1:59 pm

Re: Patricknet Grub Help

Post by egos »

It's like a script for creating floppy image, therefore using the BPB fields is not planned at all.
If you have seen bad English in my words, tell me what's wrong, please.
madeofstaples
Member
Member
Posts: 204
Joined: Thu Apr 12, 2007 8:15 am
Location: Michigan

Re: Patricknet Grub Help

Post by madeofstaples »

01000101 wrote:I was implying that it should not be used as public domain as it had a copyright, but that the actual status is unknown (by myself). Also, there are a lot of people out there that claim to have copyrighted material that dont, I consider it still copyrighted as it keeps things on the safe side, but still.
It still does have a copyright. The year following the copyright is the year of the first publication of the work, not its expiration. Copyrights can last 50-100 years after the author's death. Any work, even without specifying explicitly, is technically copyrighted (assuming the Berne Convention applies in your country), so your assumption is a good one.

However, as long as you don't blatantly do something immoral such as take the work and mass-market it (especially as your own), I don't think you'd be causing any (statutory) damage to the author, so I'd say using it in a homebrew OS should be fine...
Some people are offended by the verifiable truth; such people tend to remain blissfully unencumbered by fact.
If you are one of these people, my posts may cause considerable discomfort. Read at your own risk.
Post Reply