Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/arch/atari/stand/installboot



On Nov 15,  1:43pm, tsutsui%ceres.dti.ne.jp@localhost (Izumi Tsutsui) wrote:
-- Subject: Re: CVS commit: src/sys/arch/atari/stand/installboot

| How about this one? (cksum seems updated properly on the real machine)

That looks nicer, go for it!

christos
| 
| --- installboot/installboot.c	2014-11-14 13:21:10.000000000 +0900
| +++ installboot/installboot.c	2014-11-14 23:03:28.000000000 +0900
| @@ -467,7 +467,10 @@
|      struct disklabel *label, u_int magic)
|  {
|  	int		 fd;
| -	uint16_t	 sum;
| +	union {
| +		struct bootblock *bbp;
| +		uint16_t *word;		/* to fill cksum word */
| +	} bbsec;
|  
|  	memset(bb, 0, sizeof(*bb));
|  
| @@ -499,10 +502,9 @@
|  	setIDEpar(bb->bb_xxboot, sizeof(bb->bb_xxboot));
|  
|  	/* set AHDI checksum */
| -	sum = 0;
| -	memcpy(bb->bb_xxboot + 255 * sizeof(sum), &sum, sizeof(sum));
| -	sum = 0x1234 - abcksum(bb->bb_xxboot);
| -	memcpy(bb->bb_xxboot + 255 * sizeof(sum), &sum, sizeof(sum));
| +	bbsec.bbp = bb;
| +	bbsec.word[255] = 0;
| +	bbsec.word[255] = 0x1234 - abcksum(bb->bb_xxboot);
|  
|  	if (verbose) {
|  		printf("Primary   boot loader: %s\n", xxb);
| 
| ---
| Izumi Tsutsui
-- End of excerpt from Izumi Tsutsui




Home | Main Index | Thread Index | Old Index