Rev 3467 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3467 | Rev 3502 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | if not defined hostid {$hostid = 0x80804a6c} |
7 | if not defined hostid {$hostid = 0x80804a6c} |
8 | if not defined freq_mhz {$freq_mhz = 75} |
8 | if not defined freq_mhz {$freq_mhz = 75} |
9 | if not defined mac_address {$mac_address = "10:10:10:10:10:24"} |
9 | if not defined mac_address {$mac_address = "10:10:10:10:10:24"} |
10 | if not defined disk_size {$disk_size = 2128486400} |
10 | if not defined disk_size {$disk_size = 2128486400} |
11 | if not defined rtc_time {$rtc_time = "2002-06-02 17:00:00 UTC"} |
11 | if not defined rtc_time {$rtc_time = "2002-06-02 17:00:00 UTC"} |
12 | if not defined num_cpus {$num_cpus = 3} |
12 | if not defined num_cpus {$num_cpus = 4} |
13 | if not defined megs_per_cpu {$megs_per_cpu = 256} |
13 | if not defined megs_per_cpu {$megs_per_cpu = 256} |
14 | if not defined cpu_class {$cpu_class = "ultrasparc-iii-plus"} |
14 | if not defined cpu_class {$cpu_class = "ultrasparc-iii-plus"} |
15 | 15 | ||
16 | ### |
16 | ### |
17 | 17 | ||
Line 93... | Line 93... | ||
93 | 93 | ||
94 | $cdrom_path = "image.iso" |
94 | $cdrom_path = "image.iso" |
95 | ($scsi_cdrom.get-component-object cd).insert (new-file-cdrom $cdrom_path) |
95 | ($scsi_cdrom.get-component-object cd).insert (new-file-cdrom $cdrom_path) |
96 | $system.set-prom-env boot-command "boot /ssm@0,0/pci@19,700000/scsi@2/disk@6,0:f" |
96 | $system.set-prom-env boot-command "boot /ssm@0,0/pci@19,700000/scsi@2/disk@6,0:f" |
97 | $system.set-prom-env auto-boot? true |
97 | $system.set-prom-env auto-boot? true |
98 | - | ||
99 | @buf = 0; |
- | |
100 | @offset = 0; |
- | |
101 | @register2Number = SIM_get_register_number(SIM_current_processor(), "g2"); |
- | |
102 | @register3Number = SIM_get_register_number(SIM_current_processor(), "g3"); |
- | |
103 | - | ||
104 | @def schedule(): |
- | |
105 | SIM_realtime_event(100, handler, 0, 0, ''); |
- | |
106 | - | ||
107 | @def handler(x): |
- | |
108 | global buf |
- | |
109 | global offset |
- | |
110 | if (SIM_simics_is_running()): |
- | |
111 | register2Value = SIM_read_register(SIM_current_processor(), register2Number); |
- | |
112 | if ((buf == 0) and register2Value == 0x18273645): |
- | |
113 | buf = SIM_read_register(SIM_current_processor(), register3Number); |
- | |
114 | SIM_write_register(SIM_current_processor(), register2Number, 0); |
- | |
115 | SIM_flush(); |
- | |
116 | print buf |
- | |
117 | elif (buf != 0): |
- | |
118 | byte = SIM_read_phys_memory(SIM_current_processor(), buf + offset, 1); |
- | |
119 | while byte != 0: |
- | |
120 | SIM_putchar(byte); |
- | |
121 | SIM_flush(); |
- | |
122 | SIM_write_phys_memory(SIM_current_processor(), buf + offset, 0, 1); |
- | |
123 | offset = (offset + 1) % 512; |
- | |
124 | byte = SIM_read_phys_memory(SIM_current_processor(), buf + offset, 1); |
- | |
125 | schedule(); |
- | |
126 | - | ||
127 | @schedule(); |
- |