/[gxemul]/trunk/src/promemul/yamon.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/src/promemul/yamon.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by dpavlin, Mon Oct 8 16:20:40 2007 UTC revision 32 by dpavlin, Mon Oct 8 16:20:58 2007 UTC
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *   *
27   *   *
28   *  $Id: yamon.c,v 1.6 2006/07/26 23:21:48 debug Exp $   *  $Id: yamon.c,v 1.8 2006/08/22 16:07:34 debug Exp $
29   *   *
30   *  YAMON emulation. (Very basic, only what is needed to get NetBSD booting.)   *  YAMON emulation. (Very basic, only what is needed to get NetBSD booting.)
31   */   */
# Line 41  Line 41 
41  #include "machine.h"  #include "machine.h"
42  #include "memory.h"  #include "memory.h"
43  #include "misc.h"  #include "misc.h"
44    #include "net.h"
45    
46  #ifdef ENABLE_MIPS  #ifdef ENABLE_MIPS
47    
# Line 48  Line 49 
49    
50    
51  /*  /*
52     *  yamon_machine_setup():
53     */
54    void yamon_machine_setup(struct machine *machine, uint64_t env)
55    {
56            char tmps[200];
57            char macaddr[6];
58            uint64_t tmpptr = env + 0x400;
59            struct cpu *cpu = machine->cpus[0];
60    
61            /*
62             *  Standard YAMON environment variables:
63             *
64             *      baseboardserial
65             *      bootfile                TODO
66             *      bootprot                TODO: Non-tftp boot
67             *      bootserport
68             *      bootserver
69             *      cpuconfig               TODO
70             *      ethaddr
71             *      fpu                     TODO
72             *      gateway
73             *      ipaddr                  TODO: Don't hardcode!
74             *      memsize
75             *      modetty0
76             *      modetty1
77             *      prompt
78             *      start                   TODO
79             *      startdelay              TODO
80             *      subnetmask              TODO: Real subnet mask
81             *      yamonrev
82             */
83    
84            add_environment_string_dual(cpu, &env, &tmpptr,
85                "baseboardserial", "0000000000");
86    
87            /*  TODO: Disk boot!  */
88            add_environment_string_dual(cpu, &env, &tmpptr, "bootprot", "tftp");
89    
90            add_environment_string_dual(cpu, &env, &tmpptr, "bootserport", "tty0");
91    
92            add_environment_string_dual(cpu, &env, &tmpptr,
93                "bootserver", "10.0.0.254");
94    
95            net_generate_unique_mac(machine, (unsigned char *) macaddr);
96            snprintf(tmps, sizeof(tmps), "%02x.%02x.%02x.%02x.%02x.%02x",
97                macaddr[0], macaddr[1], macaddr[2],
98                macaddr[3], macaddr[4], macaddr[5]);
99            add_environment_string_dual(cpu, &env, &tmpptr, "ethaddr", tmps);
100    
101            add_environment_string_dual(cpu, &env, &tmpptr,
102                "gateway", "10.0.0.254");
103    
104            /*  TODO: Don't hardcode!  */
105            add_environment_string_dual(cpu, &env, &tmpptr,
106                "ipaddr", "10.0.0.1");
107    
108            snprintf(tmps, sizeof(tmps), "0x%08x", machine->physical_ram_in_mb<<20);
109            add_environment_string_dual(cpu, &env, &tmpptr, "memsize", tmps);
110    
111            add_environment_string_dual(cpu, &env, &tmpptr,
112                "modetty0", "38400,n,8,1,none");
113    
114            add_environment_string_dual(cpu, &env, &tmpptr,
115                "modetty1", "38400,n,8,1,none");
116    
117            add_environment_string_dual(cpu, &env, &tmpptr, "prompt", "YAMON");
118    
119            add_environment_string_dual(cpu, &env, &tmpptr, "yamonrev", "02.06");
120    
121            /*  TODO: Real subnet mask:  */
122            add_environment_string_dual(cpu, &env, &tmpptr,
123                "subnetmask", "255.0.0.0");
124    
125    
126            /*  FreeBSD development specific:  */
127            snprintf(tmps, sizeof(tmps), "%i", machine->emulated_hz / 1000);
128            add_environment_string_dual(cpu, &env, &tmpptr, "khz", tmps);
129    
130            /*  NULL terminate:  */
131            tmpptr = 0;
132            add_environment_string_dual(cpu, &env, &tmpptr, NULL, NULL);
133    }
134    
135    
136    /*
137   *  yamon_emul():   *  yamon_emul():
138   *   *
139   *  YAMON emulation (for evbmips).   *  YAMON emulation (for evbmips).

Legend:
Removed from v.31  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26