Welcome, Guest. Please Login.
YaBB - Yet another Bulletin Board
09/05/10 at 08:13:47
News: Welcome to the beans' forum.
Home Help Search Login


1  General Category / Question And Answer / New release of source code? Is beanos still alive?
 on: 10/20/08 at 09:55:40 
Started by cyberkoa | Post by cyberkoa
I have been knowing BeanOS since 2006 when I was working in Mexico . And I have taken some time to read the BeanOS source code to learn to write an OS.
 
Although at the end I didn't totally understand the whole BeanOS , I was able to get the concept of how an OS is developed, and how to implement a memory manager , how a booting process is ? and how to write a simple boot loader.
 
There are still more code to be explored, it is quite pity that this project seems abandoned.  
 
 
Reply Quote Notify of replies  

2  General Category / Question And Answer / Re: boot程序的疑问
 on: 01/13/08 at 23:17:53 
Started by jacky_zz | Post by ohion
你的问题1、2的原因应该是没有用远跳转,应该是jmp dword而不是jmp。也就是说run前面的语句都没有用处。我对汇编也不熟悉,我想大概是这个原因。
Reply Quote Notify of replies  

3  General Category / Question And Answer / boot程序的疑问
 on: 01/13/08 at 20:54:27 
Started by jacky_zz | Post by jacky_zz
你好,看了你写的boot程序,我自己编写了一个boot程序,但在实践过程中遇到一些问题,希望得到你的指点,汇编代码如下:
org 0h
start:              
    ;从ds:si复制boot代码到es:di
    mov ax, 07c0h   ;问题1:不管我设置ax的值为什么,都能输出信息"Hello, welcome to use JACKY_ZZ's first OS."  
    mov ds, ax      ;ds=07c0h
     
    mov ax, 9000h
    mov es, ax      ;es=9000h
     
    mov cx, 256     ;复制256字,即512字节    
    sub di, di      ;使di为零
    sub si, si      ;使si为零
     
    rep  
    movsw           ;开始复制boot代码
     
    jmp 9000h:[run] ;跳转到9000h:[run]
                   ;问题2:但我跳转后CS的值并未变为9000h,依旧是0000h
 
run:
    ;设置DS和ES
    xor ax, ax
    mov ax, cs
    mov ds, ax
    mov es, ax
Repeat:
  call DispStr
  jmp $
DispStr:
  mov ax, BootMessage  
  add ax, 07c00h       ;问题3:如果不加这一句的话,就不能输出信息"Hello, welcome to use JACKY_ZZ's first OS."  
  mov bp, ax
  mov cx, 42
  mov ax, 01301h
  mov bx, 000dh
  mov dl, 0
  int 10h
  ret
BootMessage: db "Hello, welcome to use JACKY_ZZ's first OS.",13,10,0
 
org 7DFEh   ;指向引导扇区的第510字节
dw 0AAEEh   ;设置Magic Singnature(魔法标识,BISO自动识别)
Reply Quote Notify of replies  

4  General Category / Question And Answer / Re: is this a bug??
 on: 10/31/07 at 00:52:48 
Started by Ruxbin | Post by Ruxbin
Quote from YaBB Administrator on 10/30/07 at 04:42:55:
You can change this place as you think and run, to see whether the floopy drive can work well . hehe ^^

yes you are right. I think that programming the hardware is quite an overhead. I must quite clear about the registers, their addersses and some other details. undecided
Reply Quote Notify of replies  

5  General Category / Question And Answer / Re: is this a bug??
 on: 10/30/07 at 04:42:55 
Started by Ruxbin | Post by YaBB Administrator
You can change this place as you think and run, to see whether the floopy drive can work well . hehe ^^
Reply Quote Notify of replies  

6  General Category / Question And Answer / Re: one question in function fd_init
 on: 10/30/07 at 01:36:39 
Started by Ruxbin | Post by Ruxbin
oh......now in dma.h I found this:
#define DMA1_CMD_REG                         0x08                        /* command register (w) */
#define DMA1_STAT_REG                         0x08                        /* status register (r) */
#define DMA1_REQ_REG                  0x09                   /* request register (w) */
#define DMA1_MASK_REG                       0x0A                         /* single-channel mask (w) */
#define DMA1_MODE_REG                       0x0B                         /* mode register (w) */
#define DMA1_CLEAR_FF_REG           0x0C                         /* clear pointer flip-flop (w) */
#define DMA1_TEMP_REG               0x0D                    /* Temporary Register (r) */
#define DMA1_RESET_REG                       0x0D                          /* Master Clear (w) */
#define DMA1_CLR_MASK_REG     0x0E                     /* Clear Mask */
#define DMA1_MASK_ALL_REG     0x0F                      /* all-channels mask (w) */
 
#define DMA2_CMD_REG                         0xD0      /* command register (w) */
#define DMA2_STAT_REG                         0xD0      /* status register (r) */
#define DMA2_REQ_REG                  0xD2    /* request register (w) */
#define DMA2_MASK_REG                        0xD4      /* single-channel mask (w) */
#define DMA2_MODE_REG                        0xD6      /* mode register (w) */
#define DMA2_CLEAR_FF_REG            0xD8      /* clear pointer flip-flop (w) */
#define DMA2_TEMP_REG                0xDA    /* Temporary Register (r) */
#define DMA2_RESET_REG                         0xDA      /* Master Clear (w) */
#define DMA2_CLR_MASK_REG       0xDC    /* Clear Mask */
#define DMA2_MASK_ALL_REG       0xDE    /* all-channels mask (w) */
 
things are quite clear ......they are the registers belong to DMA... Smiley
Reply Quote Notify of replies  

7  General Category / Question And Answer / Re: one question in function fd_init
 on: 10/30/07 at 01:15:30 
Started by Ruxbin | Post by Ruxbin
Quote from YaBB Administrator on 10/29/07 at 04:49:20:
http://oldlinux.org/
Here, you can find what you need. early version of linux is a very good example.


 SmileyI've found a good document about floppy programming. Now, I've understood the most part of floppy.c. But one small confusing still goes.....
 
    outputb(0xda, 0x00);  
     fd_delay(1);  
     outputb(0x0d, 0x00);  
     fd_delay(1);  
     outputb(0xd0, 0x00);  
     fd_delay(1);  
     outputb(0x08, 0x00);  
     fd_delay(1);  
     outputb(0xd6, 0xc0);  
     fd_delay(1);  
     outputb(0x0b, 0x46);  
     fd_delay(1);  
     outputb(0xd4, 0x00);  
     fd_delay(1);  
Since a floppy(contains 0x3f2'DOR',0x3f4'STATUS',0x3f5'DATA',0x3f7'DIR/DCR') dosen't contain this set of registers(0xda,0x0d,0xd0,0x08,0xd6,0x0b,0xd4) what's the meaning of the above codes? undecided
 
Best wishes.
Reply Quote Notify of replies  

8  General Category / Question And Answer / is this a bug??
 on: 10/30/07 at 00:55:44 
Started by Ruxbin | Post by Ruxbin
Hello.In floppy.c ln 76
static int fd_inb(void){
     unsigned char ret;
 
     fd_wait_stat(STATUS_READY|STATUS_DIR|STATUS_BUSY, STATUS_READY|STATUS_DIR|STATUS_BUSY);
     inputb(FD_DATA,ret);
       return ret;
     
}
 
I think "fd_wait_stat(STATUS_READY|STATUS_DIR|STATUS_BUSY, STATUS_READY|STATUS_DIR|STATUS_BUSY);" should be changed to "fd_wait_stat(STATUS_READY|STATUS_DIR|STATUS_BUSY, STATUS_READY|STATUS_DIR);"
since STATUS_BUSY means that FDC is busy executing commands, right??
 
ps: I'm reading the earliest version code. Wink
Reply Quote Notify of replies  

9  General Category / Question And Answer / Re: one question in function fd_init
 on: 10/29/07 at 04:49:20 
Started by Ruxbin | Post by YaBB Administrator
http://oldlinux.org/  
Here, you can find what you need. early version of linux is a very good example.
 
Reply Quote Notify of replies  

10  General Category / Question And Answer / one question in function fd_init
 on: 10/29/07 at 02:56:05 
Started by Ruxbin | Post by Ruxbin
hello.
Now, I'm proceeding in reading the file system part of bean OS and I've gained an overview about how it was implemented. But some details are quite confusing.
In funciton fd_init(floppy.c) this slice of code is  undecided
              /* setup DMAC */
     outputb(0xda, 0x00);
     fd_delay(1);
     outputb(0x0d, 0x00);
     fd_delay(1);
     outputb(0xd0, 0x00);
     fd_delay(1);
     outputb(0x08, 0x00);
     fd_delay(1);
     outputb(0xd6, 0xc0);
     fd_delay(1);
     outputb(0x0b, 0x46);
     fd_delay(1);
     outputb(0xd4, 0x00);
     fd_delay(1);
I googled for some tutorials about floppy. It seems like that port 0xda,0x0d,0xd0......has never appeared. Can you explain them for me or give me some links or files about floppy driver etc.
Thank you.. Wink
Reply Quote Notify of replies