|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <title>Days since the last Hubris kernel bug</title> |
| 6 | + <link rel="preload" href="https://oxide.computer/fonts/NeueHaasGrotDisp-Roman.woff2" as="font" type="font/woff2" crossorigin="true"> |
| 7 | + <link rel="stylesheet" href="/style.css"> |
| 8 | +<style> |
| 9 | +td { |
| 10 | + padding: 5px; |
| 11 | +} |
| 12 | +td.delta { |
| 13 | + color: #7e8385; |
| 14 | +} |
| 15 | +td.bar { |
| 16 | + position: relative; |
| 17 | +} |
| 18 | +/* Vertical line */ |
| 19 | +td.bar::before { |
| 20 | + content: ''; |
| 21 | + position: absolute; |
| 22 | + top: 0; |
| 23 | + bottom: 0; |
| 24 | + left: 7%; |
| 25 | + width: 2px; |
| 26 | + height: 10px; |
| 27 | + background-color: #7e8385; |
| 28 | +} |
| 29 | +p#days { |
| 30 | + font-size: 4.5rem; |
| 31 | + line-height: 1.05; |
| 32 | + letter-spacing: 0.02em; |
| 33 | + font-weight: 300; |
| 34 | + margin: 0px; |
| 35 | + color: #F5B944; |
| 36 | +} |
| 37 | + |
| 38 | +hr { |
| 39 | + border: 1px solid #2D3335; |
| 40 | +} |
| 41 | +</style> |
| 42 | +</head> |
| 43 | + |
| 44 | +<body> |
| 45 | + |
| 46 | + <p>It has been</p> |
| 47 | + <p id="days"></p> |
| 48 | + <p>since the last Hubris kernel bug:</p> |
| 49 | + <table id="bugs"></table> |
| 50 | + <hr> |
| 51 | + <p><a href="/">Back</a></p> |
| 52 | + |
| 53 | +<script> |
| 54 | +const bugs = [ |
| 55 | + ["issues/1876", "2024-09-20T13:54Z", "Stack scribbling does not work for tasks with pow2 stack"], |
| 56 | + ["issues/1672", "2024-04-20T18:41Z", "Leases cannot span MPU regions"], |
| 57 | + ["issues/1193", "2023-03-08T17:41Z", "Hard fault during MPU configuration"], |
| 58 | + ["issues/1134", "2023-02-08T17:31Z", "Stack overflow on SVC entry performs SVC from the wrong task"], |
| 59 | + ["issues/1017", "2022-12-22T14:58Z", "Off-by-one in ARMv8 MPU RLAR programming"], |
| 60 | + ["pull/569/commits/023e4eaa0", "2022-05-25T17:57Z", "Incorrect task pointer in context saving sequence"], |
| 61 | + ["issues/367", "2022-01-18T12:51Z", "Can't use IRQ #0 on ARMv7M"], |
| 62 | +] |
| 63 | +const prefix = "https://github.com/oxidecomputer/hubris" |
| 64 | + |
| 65 | +let now = new Date(); |
| 66 | +let days = document.getElementById("days"); |
| 67 | +function update() { |
| 68 | + const dt = daysBetween(new Date(), new Date(bugs[0][1])); |
| 69 | + const p = document.getElementById("days"); |
| 70 | + p.innerHTML = `${dt} days` |
| 71 | + setTimeout(update, 60 * 1000); |
| 72 | +} |
| 73 | +update(); |
| 74 | + |
| 75 | +// Function to calculate the difference in days between two dates |
| 76 | +function daysBetween(date1, date2) { |
| 77 | + const oneDay = 1000 * 60 * 60 * 24; |
| 78 | + const diffInTime = new Date(date1) - new Date(date2); |
| 79 | + return Math.round(diffInTime / oneDay); |
| 80 | +} |
| 81 | + |
| 82 | +const bugsContainer = document.getElementById("bugs"); |
| 83 | +const barElement = document.createElement("tr"); |
| 84 | +barElement.innerHTML = `<td><td class="bar">` |
| 85 | + |
| 86 | +// Loop through the bugs array and add each bug and the days between to the div |
| 87 | +for (let i = 0; i < bugs.length; i++) { |
| 88 | + const bugLink = bugs[i][0]; |
| 89 | + const bugDate = bugs[i][1]; |
| 90 | + const bugDesc = bugs[i][2]; |
| 91 | + let daysSinceLastBug = ""; |
| 92 | + |
| 93 | + // Calculate days between this bug and the previous one, if applicable |
| 94 | + if (i > 0) { |
| 95 | + const deltaElement = document.createElement("tr"); |
| 96 | + const previousBugDate = bugs[i - 1][1]; |
| 97 | + const daysDiff = daysBetween(previousBugDate, bugDate); |
| 98 | + deltaElement.innerHTML = `<td><td class="delta">${daysDiff} days`; |
| 99 | + |
| 100 | + bugsContainer.appendChild(barElement.cloneNode(true)); |
| 101 | + bugsContainer.appendChild(deltaElement); |
| 102 | + bugsContainer.appendChild(barElement.cloneNode(true)); |
| 103 | + } |
| 104 | + |
| 105 | + const etcElement = document.createElement("tr"); |
| 106 | + etcElement.innerHTML = `<td>${new Date(bugDate).toLocaleDateString()}<td><a href="https://github.com/oxidecomputer/hubris/${bugLink}">${bugDesc}</a>` |
| 107 | + bugsContainer.appendChild(etcElement); |
| 108 | +} |
| 109 | + |
| 110 | +bugsContainer.appendChild(barElement); |
| 111 | +const bugElement = document.createElement("tr"); |
| 112 | +bugElement.innerHTML = `<td><td class="delta">...and so on`; |
| 113 | +bugsContainer.appendChild(bugElement); |
| 114 | + |
| 115 | +</script> |
| 116 | + |
| 117 | +</body> |
| 118 | +</html> |
0 commit comments